The fix is two-part: raise WP_MEMORY_LIMIT in wp-config.php so WordPress can request more memory, and find out what's actually consuming it, because a higher limit without fixing the cause just delays the next crash.
The full error usually reads something like Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /path/to/file.php on line 123. That number is bytes, not a setting name. 268435456 bytes is 256MB. Whatever number you see, it tells you the ceiling WordPress hit.
WP_MEMORY_LIMIT vs PHP's memory_limit
There are two different memory limits at play, and mixing them up wastes time.
- PHP's
memory_limitis a server-level setting. It caps how much memory any PHP script is allowed to use, WordPress or not. This is set at the PHP level, not in WordPress files. WP_MEMORY_LIMITis a WordPress-level constant defined inwp-config.php. It sets the memory ceiling WordPress itself requests, but it can't exceed what PHP'smemory_limitallows. RaisingWP_MEMORY_LIMITpast the PHP ceiling does nothing: PHP still enforces its own limit underneath.
Check what your account's PHP memory_limit is actually set to before you touch anything else. Create a file called phpinfo.php in your site root with:
Visit it in your browser, search the page for
memory_limit, then delete the file when you're done (never leave aphpinfo()file sitting on a live site). If yourWP_MEMORY_LIMITis already at or above that PHP ceiling, raising it further in wp-config won't help. Open a ticket via Support → New ticket in the portal if you need the PHP-level limit raised.Raise WP_MEMORY_LIMIT in wp-config.php
Open
wp-config.phpvia FTP or the file manager. Add this line before the/* That's all, stop editing! */comment:define('WP_MEMORY_LIMIT', '256M');If a lower value is already defined, raise it. Common steps are 256M, then 512M if the error persists. There's also
WP_MAX_MEMORY_LIMIT, which controls the ceiling for admin-side processes like the Dashboard and cron, separate from front-end pages:define('WP_MAX_MEMORY_LIMIT', '512M');Reload the site or the admin action that was failing. If the error is gone, you've bought headroom, but that headroom disappears again as content and plugins grow. Treat this as a stopgap, not a fix.
Find what's actually eating the memory
A memory exhaustion error is a symptom. Something is allocating more than it should, and it's worth finding before it happens again at a higher limit.
- Deactivate plugins one at a time. If the error only happens on a specific admin screen or during a specific action (saving a post, running an import, generating a report), that narrows the suspect list fast. Deactivate half your plugins, test, then bisect from there.
- Look at what you were doing when it happened. Bulk imports, PDF or image generation, large exports, and report-building plugins are frequent causes. These load large datasets into memory at once.
- Check recently updated or added plugins. A plugin update that introduced a memory leak or a new heavy dependency is a common trigger for an error that "started happening out of nowhere."
- Enable
WP_DEBUG_LOGtemporarily to capture the exact file and line from the error, which often names the plugin or theme function responsible.
Heavy plugins are also a general performance drag even when they don't cause a hard crash. If your site feels sluggish beyond just this error, My WordPress site is slow covers auditing plugin weight and image handling in more depth.
PHP version matters too
Newer PHP versions handle memory more efficiently than older ones. If you're running an old PHP version for legacy plugin compatibility, that's worth weighing against the memory savings a modern version offers. See What PHP version should I use for WordPress? for how to check and switch from the PHP tile.
When it's not a plugin problem
If the memory error started right after a WordPress core update, a theme update, or shows up alongside database connection issues, the cause may sit outside plugin territory. A site that can't reach its database will throw a different error, covered in Fixing WordPress database connection errors, but it's worth ruling out if errors are stacking up together.
Also worth checking before you assume it's a rogue plugin: a corrupted database table or a runaway query can inflate memory use during otherwise normal page loads. If repair steps are relevant, they're covered in the database connection article above.
When to contact support
If you've confirmed the PHP memory_limit itself is the ceiling (not WP_MEMORY_LIMIT) and you need it raised, or if you've isolated the problem to something server-side rather than a specific plugin, open a ticket via Support → New ticket in the portal. Include the exact error text with the byte number, and mention what you were doing when it happened. A real person will look at it, and if it needs a server-level change, that's on us to make.