Seeing a 'fatal error: allowed memory size exhausted' in WordPress? This is one of the most common issues site owners face, often due to plugins or themes demanding more resources than allocated. As experienced WordPress developers, we've resolved this countless times by simply increasing the PHP memory limit. Follow our proven steps below.

WordPress runs on PHP, a server-side scripting language. Like any computer, web servers require memory (RAM) to handle multiple processes efficiently. Hosts allocate a fixed memory amount to PHP scripts.
When your site's code—such as resource-heavy plugins or large imports—exceeds this limit, WordPress throws an error.
Error grave: el tamaño de memoria permitido de 33554432 bytes se agotó (se intentó asignar 2348617 bytes) en /home4/xxx/public_html/wp-includes/plugin.php en la línea xxx

By default, WordPress tries to bump the limit to 64MB automatically, but that's frequently too low for modern sites with complex functionality.
Let's fix this by safely increasing the PHP memory limit.
Start by editing your site's wp-config.php file, found in the root directory. Use an FTP client like FileZilla or your host's file manager (e.g., cPanel).
Add this line just before the comment reading That's it, stop editing! Happy blogging.:
define('WP_MEMORY_LIMIT', '256M');This sets WordPress to use up to 256MB of memory—ample for most sites.
Save the file and re-upload if edited locally. Refresh your WordPress site; the error should vanish.
If you're new to this, see our beginner's guide on copying and pasting code safely or our detailed tutorial on editing wp-config.php.
Important: If changes don't take effect, your host may restrict user-level overrides. Contact support to request a higher PHP memory limit.
We've helped thousands of sites with this tweak—problem solved reliably.
Check our complete WordPress troubleshooting guide for more tips.
Liked this? Subscribe to our WordPress YouTube channel for video tutorials. Follow us on Twitter and Facebook.