The progress of a WordPress website, the more memory it consumes. In thecsphere that WordPress’s memory limit defaults to value of 64MB. Very mean! An error which looks as the following is not too long to be experience as a result of growth:
Fatal error: Allowed memory size of XXXXXXX bytes exhausted (tried to allocate XXXXXXX bytes) in /home/mysite/public_html/wp-includes/plugin.php on line XX
Are you seeing an allowed memory size exhausted error in WordPress? This is one of the most common WordPress errors , and you can easily fix it by increasing the php memory limit in WordPress. After reading this article, you can easily Fix Allowed Memory Size Exhausted Error in WordPress all by yourself.
What is Exhausted Memory Size Error in WordPress?
In most cases WordPress code demands more memory than the default allocated memory, though, WordPress actually upped it to 64M but it certainly needs more that. Obviously, “allowed memory size exhausted error” in WordPress is inevitable.
Your web server requires memory to efficiently run multiple softwares and synchronize actions. Server administrators allocate specific memory size to different applications including PHP (which WordPress is written).
Solve PHP Memory Limit Error in WordPress
Absolutely, you are longing for a medium to fix WordPress allowed memory size limit; to be concise, how to increase PHP memory limit in WordPress. Be rest assured, you are covered.
To increase the PHP memory limit, we will show you how to fix WordPress memory exhausted error by increasing PHP memory with simplest methods. So, you can opt in for the most convenient one.
Increase via wp-config.php
One of the major and easiest method to increase memory limit in WordPress is through wp-config.php file. This file is located at your WordPress installation’s root directory.
Connect to your FTP Client, straight to your website root directory. Edit and add the following lines to the file, above the line which reads // ** MySQL settings – You can get this info from your web host ** // :
/** Increase PHP memory limit */
define( 'WP_MEMORY_LIMIT', '200M' );
Do note that the memory limit now will be 200M . Meanwhile, you can increase the value to up the memory limit to a higher amount if you wish.
Increase via php.ini
If the above method works not or seems somehow, edit your website’s php.ini file as follows:
memory_limit = 200M ; Maximum amount of memory a script may consume ( 200M )
Or better still, you can try out the next solution.
Increase via .htaccess file:
If you don’t have access to PHP.ini, you can try adding following line code to an .htaccess file:
php_value memory_limit 200M
Save the file. Visit your site in a browser. The “memory exhausted” error will be gone. If the error is still occurring, you may need to increase the WordPress memory limit to a higher number, and/or increase the size of your server itself.
Contact your Web Hosting Provider
If this solutions does not work for you, then this means your web hosting service provider does not allow WordPress to increase PHP memory limit. You will need to ask your web hosting provider to increase your PHP memory limit manually.
That’s all, we hope this article helped you solve WordPress memory exhausted error by increasing PHP memory limit.