WordPress Hosting Tips: Setting Memory Limits

WordPress Hosting Tips: Setting Memory Limits

Does your WordPress site feel a little slow after adding a few plugins to your site? Well it is no wonder as the default settings for how much memory WP allocates to PHP processing are as follows:

define(‘WP_MAX_MEMORY_LIMIT’, ’64M’);
define(‘WP_MEMORY_LIMIT’, ’40M’);

For some sites, these limits are OK… but for most they really are not!

To easily modify these settings, just add the following lines to the top of your wp-config.php file in your WordPress installation directory:

For example:

define( ‘WP_MAX_MEMORY_LIMIT’, ‘512M’ );
define(‘WP_MEMORY_LIMIT’, ‘512M’);

Now your WP installation will allocate up to 512M of memory to processing PHP, i.e. the underlying code which runs everything on a WordPress powered website… just like this site!

So, if you are feeling the ‘pain’ of too many plugins slowing down your site, don’t forget to take a look at your settings and increase your PHP memory limits.

For most of our clients they will never need to increase their limits simply because we run our servers using OPCache, which pre compiles and caches PHP code into memory on the server already, thus reducing the load on your personal account or WP installation as most memory required for processing PHP is for the compile process which normally executes every time the code is run.

Most sites will never need more than 256M of memory for PHP processing, so start there and increase to 512M max as needed.

Team Tuned!

Leave a Reply

Your email address will not be published. Required fields are marked *