Should i increase wordpress memory limit?

The default value of the WordPress memory limit is set to 256 MB on all SiteGround servers. To increase it, edit the wp-config.php file of your application. You can use the Site Tools -> File Manager to open the file for editing. The file is located in the folder where you installed your WordPress application (/home/customer/www/yourdomain.com/public_html by default). Copy this line:

define( 'WP_MEMORY_LIMIT', '512M' );

and paste it into the file, right before this one:

/* That’s all, stop editing! Happy publishing. */

You can replace the value you see in the quotes to with a new one up to 512 MB on all shared hosting accounts. On Cloud solutions, you may further increase the number.

If the line is already present in the file, you can edit the value in the quotes only and set it to its desired value.

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. In this article, we will show you how to fix WordPress memory exhausted error by increasing PHP memory.

Should i increase wordpress memory limit?

What is WordPress Memory Exhausted Error?

WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server for it to function properly.

Web servers are just like any other computer. They need memory to efficiently run multiple applications at the same time. Server administrators allocate specific memory size to different applications including PHP.

When your WordPress code requires more memory than the default allocated memory, you get to see this error.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx

Should i increase wordpress memory limit?

By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high enough.

Having said that, let’s see how to easily increase PHP memory limit in WordPress to avoid memory exhausted error.

Increase PHP Memory Limit in WordPress

First you need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.

Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’

define( 'WP_MEMORY_LIMIT', '256M' );

This code tells WordPress to increase the PHP memory limit to 256MB.

Once you are done, you need to save your changes and upload your wp-config.php file back to your server.

You can now visit your WordPress site and memory exhausted error should disappear now.

If you are new to WordPress, then take a look at our beginners guide on how to copy and paste code from the web.

We also have a step by step guide on how to find and edit wp-config.php file.

Note: If this solution 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. You may also want to see our step-by-step beginner’s guide to troubleshooting WordPress errors.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

Should i increase wordpress memory limit?

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. We have been creating WordPress tutorials since 2009, and WPBeginner has become the largest free WordPress resource site in the industry.

Reader Interactions

What is a good WordPress memory limit?

What is the recommended PHP memory limit in WordPress? WordPress has a 32MB memory limit by default, but some hosting providers increase this to 64MB for all customers. It's also possible to go even bigger — all the way up to 256MB.

What should my PHP memory limit be?

A typical appropriate memory limit for PHP running Drupal is 128MB per process; for sites with a lot of contributed modules or with high-memory pages, 256MB or even 512MB may be more appropriate.

How do I increase WordPress memory limit?

Here's what you need to do:.
Locate or find your php. ini file. ... .
Use your favorite editor to open and edit your php. ini file..
Look for the line that says 'memory limit = 32M'..
Change the 32M or some other number to the desired limit (e.g. 256M or 512M)..
Restart your localhost or server after saving your changes..

How do I check my WordPress memory limit?

If you're running WordPress 5.2 or above, you can use the Site Health tool to check what the current PHP memory limit is on your site. In your WordPress dashboard, go to “Tools” → “Site Health” → “Info” and scroll down to the server section. Here you can see that the PHP memory limit is on your server.