WordPress Memory Exhausted Error – Increase PHP Memory

Are you getting a WordPress error that says “Allowed Memory Size Exhausted”? This is one of the most common WordPress errors, and it’s simple to fix by increasing WordPress’s php memory limit. In this article, we’ll show you how to increase PHP memory to fix the WordPress memory exhausted error.

Increase PHP Memory to Fix the WordPress Memory Exhausted Error

What is the meaning of the WordPress Memory Exhausted Error?

PHP is a server-side programming language, and WordPress is written in it. For a website to function properly, it requires a WordPress hosting server.

Web servers operate in the same way as any other computer. They require memory to run multiple applications efficiently at the same time. Different applications, including PHP, are allotted different amounts of memory by server administrators.

This error appears when your WordPress code requires more memory than the default allocated memory.

1
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

On a WordPress site, the error "memory exhausted" appears.

If the PHP memory limit is less than 64MB, WordPress will try to increase it by default. However, 64MB is frequently insufficient.

After that, let’s look at how to increase the PHP memory limit in WordPress to avoid memory exhaustion.

In WordPress, increase the PHP memory limit.

To begin, go to your WordPress site’s wp-config.php file and make the necessary changes. It’s in the root folder of your WordPress site, and you’ll need to use an FTP client or your web hosting control panel’s file manager to access it.

Then, just before the line that says ‘That’s all, stop editing!’, paste this code into the wp-config.php file. ‘Have fun blogging.’

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

This code tells WordPress that the PHP memory limit should be increased to 256MB.

When you’re finished, save your changes and re-upload your wp-config.php file to your server.

You should now be able to access your WordPress site, and the memory exhausted error should be gone.

Note: If this solution doesn’t work for you, it’s because your web hosting provider won’t let you increase the PHP memory limit. You’ll have to manually request that your web hosting provider increase your PHP memory limit.

That’s all there is to it; we hope this article assisted you in resolving the WordPress memory exhausted error by increasing the PHP memory limit.