As a CMS, WordPress runs on a memory and server. Depending on your database and the server you choose, you might run out of its memory which hinders your website to work properly. Such is a case with many WordPress users worldwide who report of receiving the error message of WordPress Memory Exhausted. Don’t worry! You can fix it on your own even if you don’t know high-end technicalities.
You can have more resources by modifying your WP site a little bit. It takes only a few minutes and you will get rid of the WordPress memory exhausted error.
Before explaining the fix, let us help you learn what the fatal error “WordPress memory exhausted” means.
Explaining WordPress Memory Exhausted Error
WordPress is built on PHP which uses the term “fatal error” for the issues that hinder the website from running a script. Scripts are those codes that help the website to know how it should behave in response to a specific action or input. Since WP runs on servers, it needs enough memory size from the server administrators to efficiently run its scripts. When the memory size gets filled up, the WP site runs into an error called “WordPress Memory Exhausted” which looks like this:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/example/public_html/wp-includes/plugin.php on line example
The good news is that you can resolve this issue by increasing your PHP memory in your WordPress website.
Fix: WordPress Memory Exhausted Error
In case your PHP memory is less than 64MB, your WP will by default try to increase it on its own. If that’s still not enough and you’re receiving memory issue on your WordPress website, you can increase your PHP memory on your own with this simple method.
You need to use a file manager in your WP control panel or an FTP client to edit a file called the wp-config.php file. Since this file sits in the root folder of a WordPress site, you need to use the file manager or FTP.
Copy and paste the code provided below in the wp-config.php file anywhere (recommended is adding immediately) before the sentence that says, “That’s all, stop editing! Happy blogging.”
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
This is the code that will increase your WordPress’ PHP memory size to 256MB.
Save the changes and upload the modified wp-config.php file to the server again.
Revisit your WordPress website to check if the error has vanished from it.
That’s all it takes! This method works for resolving WordPress memory exhausted error in all cases. However, if your issue still persists that means your WP hosting provider allows only the given limit. You can ask your provider to increase the PHP memory size from the administration end so that you can work smoothly on your WP website. In this way, you can add more media and content on your website to maintain your desired traffic on the website.