If you here on this article that means you already know about WordPress Memory and PHP memory limit and I don’t need to explain them. The thing is to install high performance demanding themes and plugins you need to increase the WordPress Memory Limit. By default, the WordPress Memory Limit is 40M and to increase this first you should be aware of the maximum memory assigned or available for PHP. If you want to find out the max PHP memory then see our article: How to check PHP memory limit in WordPress.
Coming to the main topic, many times even after increasing the amount of WordPress Memory Limit by defining a simple piece of code which I will let you know in this article, still at the WordPress Dashboard or in some plugin it shows 40M only. If you too facing this issue then the solution is here…
To increase the WordPress Memory from 40M to 60M, 215M, 312M, 512M or whatever, it totally depends on the availability. Let say you want to increase the memory from 40M to 215M; what you have to do:
Set the PHP memory limit for WordPress Memory
- Go to your Cpanel of hosting service where the WordPress website is hosted or just access root file system public_html using FTP software.
- Find out a file called wp-config.
- Select and click on the edit option given in the top menu of cPanel.
- Now here is the tricky part of adding a small piece of the code:
define( 'WP_MEMORY_LIMIT', '215M' );
- Note: If you want to increase the memory to 128, 315, 512 or according to your requirement just replace the M value mentioned in the above code.
- If you want to increase the WordPress memory just copy and paste the above code in the WordPress wp-config file.
- Now the question arises where to paste this code. Most of the time people paste it at the end of the file and it works too but on your WordPress Dashboard or Plugins installed still consider only 40M even after defining 215M.
- So, what you have to do rather placing it at the end, paste it at the very beginning of the wp-config file just after <?php code. In this way, your WordPress memory limit increases and it will also show the same on the Dashboard for plugins.
If you face any problem or unable to understand something then comment and will instantly reply. You can also contact us via email.
Install Apache, PHP & MYSQL on Windows 11 | 10 using CMD
How to know if PHP is installed on Windows?
How to transfer a Blogger (Blogspot) site from one account to another
4 Best tools to install WordPress Local on Windows without Xampp
Instant WordPress: One click install of WordPress locally on Windows
Top 10 Ways To Protect WordPress Login From Unauthorized Access
3 thoughts on “WordPress Memory Limit Shows 40MB even after raising PHP memory limit”
Followed your directions as far as I can tell to the T… Still no such luck with increasing WP limit
First please check your host max. allowed or declared memory in the PHP. https://www.how2shout.com/wordpress-tutorial/how-to-check-wordpress-php-memory-limit-of-a-website.html
This was a huge help, thanks!