Okay
  Print

What Is The WP Memory Limit?

IMPORTANT NOTE – Please know that each hosting service is different, and the methods mentioned below may or may not work for you. Before trying these methods to increase your system status limits, it’s always best to contact your respective hosts first and ask them if they can make these adjustments for you.

WP Memory Limit

The WP Memory Limit is the maximum amount of memory (RAM) that your site can use at one time. When you reach your Memory Limit, you’ll encounter a fatal error. Several things consume memory, such as WordPress itself, the theme you’re using, and the plugins installed on your site. Basically, the more content and features you add to your site, the bigger your memory limit has to be.

Why Do I Need To Increase My WP Memory Limit?

There are a number of factors that may affect how much memory your website will need such as content, themes, plugins, etc. The default memory limit for WordPress is 32MB. If you’re only running a small site with basic functions, this default value is more than enough. However, once you start encountering ‘Fatal Error: Memory Size Exhausted…, it may be time to adjust your memory limit.

How To Increase The WP Memory Limit

To increase your memory limit, you’ll need to access and modify certain files such as the php.ini, wp-config.php, and .htaccess files. Most hosts won’t grant you full access to modify the PHP.ini file because it affects the whole server and all the websites hosted on it. Please contact your host first to find out if they can adjust it for you.

For advanced users who have their own server setups and full access to the php.ini file, please go ahead and try Method 1 first before the other methods. For standard users, we encourage you to try Method 2 and Method 3 instead.

METHOD 1: CHANGE YOUR PHP MEMORY LIMIT IN PHP.INI FILE

Step 1 – Locate your PHP.ini file. If you can’t find it, then you can create your own PHP.ini file in the root folder of your WordPress installation.

Step 2 – If you find your existing PHP.ini, open the file and locate the following line of code (xx represents a number):memory_limit = xxM;. Then change xxM to your desired limit. For example, 256M.

Step 3 – If you created your own PHP.ini file, then add the same code inside it: memory_limit = 256M;. Simply change the value to the recommended value. For example, 256M.

Step 4 – Save your changes, and reboot your local host or server.

METHOD 2: CHANGE YOUR WORDPRESS MEMORY LIMIT IN WP-CONFIG.PHP FILE

Step 1 – Locate your wp-config.php file in the root folder of your WordPress installation.

Step 2 – Open the wp-config.php with a text editor program (Notepad or TextEdit) and add the following line of code after ‘define(‘WP_DEBUG’, false);: define ('WP_MEMORY_LIMIT', '256M');. Simply change the value to the recommended value. For example, 256M.

Step 3 – Save the file and refresh your System Status tab. If the WP Memory Limit turns green, then you have successfully increased your WP Memory Limit.

METHOD 3: CHANGE YOUR PHP MEMORY LIMIT IN .HTACCESS FILE

Step 1 – Locate your .htaccess file which is usually in the root folder of your WordPress installation. If you can’t find it, it may be because it’s hidden. Here’s a tutorial for Windows and a tutorial for Mac on how to reveal hidden files.

Step 2 – Open the .htaccess file with a text editor program (Notepad or TextEdit) and add the following line of code:php_value memory_limit 256M;. Simply change the value to the recommended value. For example, 256M.

Step 3 – Save the file and refresh your website.