What "Memory Exhausted" Actually Means
PHP, the language WordPress runs on, is given a memory ceiling for each process as a safety limit — protecting the server from any single script consuming unlimited resources. When a page load, an import, an image edit, or a plugin operation tries to use more memory than that ceiling allows, PHP stops the process and returns this error instead of letting it run unchecked. It's a protective mechanism working as designed, not a random failure — which means the fix has two parts: raise the ceiling, and figure out why something needed that much in the first place.
Step 1: Raise WordPress's Own Memory Limit
Via FTP or your host's file manager, open wp-config.php and add this line just above /* That's all, stop editing! Happy publishing. */:
define( 'WP_MEMORY_LIMIT', '256M' );
This raises the limit WordPress itself requests. For admin-side operations specifically (like bulk imports or plugin installs), you can also add: define( 'WP_MAX_MEMORY_LIMIT', '512M' ); which sets a separate, higher ceiling just for wp-admin.
Step 2: Check the Server's Actual PHP Memory Limit
WordPress's WP_MEMORY_LIMIT can't exceed what the server's own PHP configuration allows — if your hosting account's server-level memory_limit is capped at 128M, setting WP_MEMORY_LIMIT to 256M in wp-config.php won't actually raise it past that server ceiling. Check your hosting control panel's PHP settings section, or contact your host, to confirm and raise the server-level limit if it's the actual bottleneck.
Step 3: Identify What's Actually Consuming the Memory
Raising the limit resolves the immediate error, but if it keeps recurring at the new, higher ceiling, something is using an unusual amount of memory and is worth identifying rather than continuing to raise the limit indefinitely. Common culprits include plugins that process large images, generate PDFs on the fly, run scheduled backups, or sync data with an external service. Deactivating plugins one at a time while monitoring whether the error returns — or checking your host's resource usage graphs for spikes tied to specific actions — will usually identify the source.
Step 4: Consider Whether the Hosting Plan Is Undersized
Shared hosting plans frequently cap PHP memory at 128MB or lower, which is genuinely tight for a modern WordPress site running a typical set of plugins — a page builder, an SEO plugin, a caching plugin, and a security plugin can add up quickly even without anything unusual happening. If the site is legitimately using more memory than a shared plan supports simply through normal operation, the durable fix is a hosting environment with proper resource allocation, not a series of increasingly high limit overrides.