Increasing your WordPress memory limit can help address memory limit issues which may occur when using demanding plugins like WooCommerce or if you have a large number of WordPress plugins installed.
By default, WordPress will try and use 40MB of PHP memory and 64MB if configured as a WordPress multisite. These limits are defined at the beginning of /wp-includes/default-constants.php.
Whilst many web hosts limit the amount of PHP memory to as little as 8MB, Ecenica shared hosting plans allow you to increase your WordPress memory to a massive 756MB of PHP memory.
Please follow our steps below to increase your WordPress memory limit;
1. Increase PHP Memory Limit in WordPress
- Open wp-config.php in your code editor, or in cPanel File Manager
- Add the following code before the
/* That's all, stop editing! Happy blogging. */
define( 'WP_MEMORY_LIMIT', '96M' );
- Change this value up to 256M.
- Save your changes
The line of code tells WordPress to increase the PHP memory limit to 256MB. This limit should be sufficient for most WordPress websites however you need more memory, you can increase this value to 768M (768MB), the maximum PHP limit on Ecenica shared hosting accounts which includes our Cloud Hosting and WordPress Hosting plans.
If your WordPress site is hosted on one of our Cloud Servers, or Dedicated Servers you can set the memory as high as you want, however please make sure it does not exceed the RAM allocated to your server.
2. Increase PHP Memory Limit
After telling WordPress how much memory to use, you will need to increase your accounts PHP memory limit as well.
Please refer to our How to increase PHP Memory article for the correct steps.