New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Memory

Learn how to fix WordPress memory limit exhausted errors.

Allowed memory size exhausted means PHP ran out of RAM while loading WordPress. Heavy plugins, page builders, and imports are common triggers. This tutorial shows how to raise limits safely and find the code that eats memory.

Time: 15-25 minutes Level: Beginner
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

WordPress defaults to 40M unless raised. Page builders, WooCommerce imports, backup plugins, and poorly coded extensions can exceed that quickly on shared hosting.

Raising memory is a short-term fix. The real goal is finding which request exhausts RAM so you can update, configure, or remove the offending plugin.

Step 1: Set WordPress memory limits in wp-config.php

Open wp-config.php in your site root, next to wp-admin and wp-content. Search for WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT first. If those lines already exist, change the values instead of adding duplicates. If none of them exist, add these constants above the stop editing line. WP_MAX_MEMORY_LIMIT applies in wp-admin where more RAM is needed.

php
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Step 2: Raise PHP memory_limit in hosting

WordPress cannot exceed the server PHP memory_limit. In cPanel go to MultiPHP INI Editor and set memory_limit to 256M. On nginx hosts, ask support or edit the pool configuration.

Step 3: Read the error for the plugin name

Memory errors often include the file path. Look for wp-content/plugins/plugin-name/ in debug.log or the on-screen fatal error. That names the extension to investigate first.

  • Enable WP_DEBUG_LOG if you only see a white screen. Search for existing WP_DEBUG constants in wp-config.php before adding duplicates.
  • Note whether the error happens on front end, wp-admin, or cron.
  • Check if it started after importing products or running a backup.

Step 4: Isolate plugins and reduce batch jobs

Rename wp-content/plugins to plugins.disabled via File Manager, SFTP, or FTP. If memory errors stop, rename plugins.disabled back to plugins, then activate plugins one at a time in wp-admin until the error returns. For imports, reduce batch size in WooCommerce or migration tools.

Step 5: Consider hosting upgrade for heavy sites

Shops with large catalogs and page builders may need more than shared hosting RAM. A VPS or managed WordPress plan with 512M or 1G PHP memory prevents recurring exhaustion on busy admin screens.

When to stop DIY and hire help

If memory errors return after raising limits to 512M, a plugin is likely leaking RAM or your host cap is too low for your stack. BugShield diagnoses memory issues at a confirmed price without hourly billing surprises.

Questions answered

WordPress memory limit exhausted FAQs

Answers about PHP memory limits, resource-heavy plugins, hosting caps, and preventing recurring WordPress memory errors.

What is a safe WP_MEMORY_LIMIT for WooCommerce?

256M is a common starting point for small shops. Large imports and page builders may need 512M on admin screens.

Will raising memory slow my site?

Higher limits do not slow normal requests. They only allow heavy operations to complete instead of causing a fatal error.

Can a theme cause memory exhausted?

Yes, especially themes with heavy option panels or demo importers. Switch to a default theme via File Manager, SFTP, or FTP to test.

Why does memory fail only in wp-admin?

Admin loads more scripts and plugin settings screens. WP_MAX_MEMORY_LIMIT applies specifically to dashboard requests.

What causes a WordPress memory limit exhausted error?

A plugin, theme, import, page builder, backup, or large admin task used more memory than PHP allowed. The error log names the limit and often the file active at failure.

What is the difference between WP_MEMORY_LIMIT and the PHP memory limit?

WordPress requests memory through WP_MEMORY_LIMIT, but it cannot exceed the server's PHP memory_limit. The lower effective ceiling controls the request.

Where do I increase the WordPress memory limit?

Start with wp-config.php, then check your hosting PHP settings if the dashboard still reports the old value. Some hosts require support to raise the server limit.

Why does increasing WP_MEMORY_LIMIT have no effect?

The host may enforce a lower PHP cap, the constant may be below the stop-editing line, or a pool-level setting may override local configuration.

How do I find a WordPress plugin using too much memory?

Use the fatal error path and a staging copy to isolate plugins, then profile the failing request. Repeatedly raising the limit can hide a leak without fixing it.

When should a developer investigate WordPress memory exhaustion?

Get help when the error returns after a reasonable limit increase, affects scheduled jobs or checkout, or one request consumes unusually large amounts of memory.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix