Meks
Do you know you can try any of our premium WordPress themes for free?Show me the themes
How to increase WordPress Memory Limit (quick fixes)

How to increase WordPress Memory Limit (quick fixes)

0Shares

Here is a post about how to increase the memory limit in WordPress. Allowed memory size exhausted error message showed up in your WordPress installation? No worries – this is one of the most common errors in WordPress. You can apply an easy fix by increasing the memory limit in your PHP.

A quick introduction to WordPress memory errors

WordPress is one of the most stable platforms today, and most of the problems you can encounter are not so difficult to fix. Memory limit error is also known as ‘PHP memory limit error, and if it happens in your WordPress installation, it will look like this.

This error happens in different circumstances, but the most common are:

  • When you try to install a new theme or a plugin
  • When you try to upload images or other media to your website

Your hosting provides this memory. When you buy your hosting plan, your site will get a specific amount of resources. As your site grows, you start using more complex plugins and scripts – you may hit your memory limit. Again, speaking WordPress – if you see this error, you won’t complete the action that you wanted to take.

Top WP Hosting recommended by Meks

Checking the WordPress memory limit

WordPress 5.2 introduced a pretty handy tool called “Site Health.” It is located in the WordPress dashboard’s Tools / Site Health section. To see the memory limit of your website, go to Tools / Site Health / Info and go to the Server section.

checking wordpress memory limit

This means that your server has a 128MB memory limit. If there is a memory limit error on your website, make sure that you increase this number. We will show several most efficient ways to do this.

If you are not 100% sure about what you are doing, please contact your hosting provider and ask them to increase your PHP memory limit for you.

Edit your wp-config.php file

Before editing the wp-config.php file, make sure that there is a backup of this file. Look for the “WP_MEMORY_LIMIT ” text inside wp-config. If you don’t find the WP_MEMORY_LIMIT line inside the wp-config.php file, you can paste it right before the part that says: “That’s all, stop editing! Happy publishing.”

If you still get the error, open the wp-config file, increase the memory limit further, re-upload the file, and see what will happen next.

Follow this link to find more info about the wp-config.php file.

Edit your PHP.ini file

If your hosting allows access to the PHP.ini file, edit it and increase the maximum amount of memory a script may consume (in this case, this is 128MB)

Edit your .htaccess file

If your host doesn’t allow access to the PHP.ini file, there is a quick but not so recommended method of modifying your .htaccess file. Before editing, please make sure that you have a backup of this file, too. Add the following code to your .htaccess file.

Final thoughts

If the methods above don’t work or aren’t successful, make sure to talk to your hosting about your hosting problems and increase your memory limit. Maybe it’s the right time to test their support skills.

Got questions or like to talk? Please subscribe to our YouTube Channel for more WordPress tutorials. You can also find us on Twitter and Facebook.

0Shares

Tags: , ,

Dusan Milovanovic

Co-founder and product developer at Meks. Started on Olivetti 286 and has been involved in the business since 2009. crafting themes, plugins, and services on top of WordPress. Addicted to smooth UX, cycling, and nature.

Try theme now for free!
  • Access to a copy of the demo website
  • Full access to the theme options
  • No credit card required

* We will send you an occasional newsletter with special offers, news & theme updates but you can unsubscribe at any time.

Meks