Admin Area

Increase WordPress Memory Limit

A common error you can come across in WordPress is a PHP memory limit error. This happens when WordPress doesn't have enough memory to achieve what you want. It can be caused by poorly written plugins that will continue to run a procedure until the installation runs out of memory.

Since version 2.5 there is a wp-config.php option WP_MEMORY_LIMIT which allows you to configure the maximum amount of memory that can be used by PHP.

When you change this option in the wp-config.php it will only affect your WordPress site and not any other PHP sites.

The default memory allocated to WordPress is 40MB for single site installs and 64MB for multisite installs. If the value in the php.ini is more than the allocated WordPress amount WordPress will use this value. For example if WordPress has allocated 40MB of memory and php.ini is configured to 64MB then WordPress will use 64MB.

To change the WordPress memory limit you just add the following into the wp-config.php.

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

If this doesn't change your allocated memory limit your hosts may not allow you change this setting, if this is the case you should contact your hosting company.

With PHP.ini

You can change the memory limit of your website in the PHP.ini file, with some web hosts you might not have access to change the PHP.ini file for your website. But if you do search for the property memory_limit and change the value to something greater like 64M.

memory_limit = 64M

With htaccess

You can even change the memory limit of PHP from your sites htaccess file. Go to the root folder of your website and create a new .htaccess file if it doesn't already exist and add the following line to your htaccess file.

php_value memory_limit 64M
Back to top

Fastest WordPress Hosting With WPEngine

Stunning speed, powerful security, and best-in-class customer service. At WP Engine.

Risk free for 60 days


  1. Thank you for the help bro. It really helped me a lot!

  2. Andreas says:

    Hi, thanks a lot! 🙂

    If I change the WP Memory Limit in wp-config, how can I check/test the allocated memory limit so it really changed and works? For example I use a plugin like "Simple System Check", but I don't know if it just read the wp-config file or the server.

    Cheers / Andreas

    1. Paul says:

      I've found this plugin to be quite good