How to Increase WordPress Memory Limit after fatal error

fatal error: allowed memory size of ######## bytes exhausted

If you’ve seen these words before, chances are you’ve got a new wordpress site on an affordable host with the default settings. Sometimes this error will go away on it’s own, but it will likely come back the next time your site’s memory allowance fills up, so it’s worth fixing as soon as you see it.

How to check your site’s memory allowance

In the WordPress Dashboard go to Tools > Site Health

Select the ‘Info’ Tab.

Down the list expand the ‘Server’ information, and you will see ‘php memory limit’. As you can see for our site, it’s showing 256M as it should, if yours is less then it is worth increasing it.

How do you fix the wordpress memory limit fatal error?

There is really only one way, to permanently prevent the fatal error – increase the memory allowance of WordPress. By itself, WordPress should run fine with 128Mb of memory. Although technically if you have a basic theme, no plugins and a simple setup it could run on a lot less. But for modern practical usage, 128Mb is the minimum for a small business site.

Elementor requires a recommended memory allowance of 256Mb. This is what we recommend changing the setting to.

Edit your wp-config.php file

If your server allows you access, you can find it in cPanel > File Manager menu > root folder of your WordPress installation.

Look for the line in the file defining ‘WP_MEMORY_LIMIT’ and change it to the following:

define('WP_MEMORY_LIMIT', '256M');

If the line isn’t present, you can add the line with the other variable definitions.

Edit your PHP.ini file

If you don’t have access to your wp-config file, you may have access to your php.ini file. If your server allows you access, you can find it in cPanel > File Manager menu > root folder of your WordPress installation.


Look for the line in the file setting ‘memory_limit’ and change it to the following:

memory_limit = 256M ;

Edit your .htaccess file

If you don’t have access to your php.ini file, you may have access to your.htaccess file. If your server allows you access, you can find it in cPanel > File Manager menu > root folder of your WordPress installation.

Look for the line in the file setting ‘memory_limit’ and change it to the following:

php_value memory_limit 256M

If you don’t feel comfortable editing these files, or don’t have access to them

If the methods above won’t work for you, likely your host has locked the settings or has a service to change them for you. Ask them to change the memory limit for your site. If they cannot or will not oblige, it might be time to upgrade hosts.

This website uses cookies to ensure you get the best experience on our website.