Are you experiencing an allowed memory size exhausted error in WordPress?
The PHP memory limit in WordPress can easily be increased to fix this problem, which is one of the most common WordPress errors.
We will explain how to fix WordPress memory exhausted error by increasing PHP memory in this article.
How do I fix WordPress Memory Exhausted Error?
The WordPress software is written in PHP, which is a server-side programming language. In order for WordPress to work properly, it needs a WordPress hosting server.
A web server is no different from any other computer. It needs memory to run multiple applications at once efficiently.
Different applications, including PHP, are given specific memory sizes by server administrators.
The error occurs when your WordPress code consumes more memory than the default allocation.
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
WordPress attempts to increase the PHP memory limit if it is less than 64MB by default. Unfortunately, 64MB is not always enough.
So, let’s examine how you can easily increase WordPress PHP memory limits to avoid memory exhaustion errors.
WordPress: Increase PHP memory limit
Your WordPress site’s wp-config.php file needs to be edited first. You can access it via an FTP client or the file manager in your web hosting control panel as it’s located in your WordPress site’s root folder.
The code must be pasted in the wp-config.php file just before the line that says ‘That’s it. Stop editing!’ Have fun.
define( 'WP_MEMORY_LIMIT', '256M'
PHP memory limit is set to 256MB in the code above.
Your wp-config.php file needs to be uploaded back to the server after you have finished making changes.
Your WordPress site should now work without the memory exhaustion error.
Note: If you cannot increase PHP memory using this solution, your web hosting provider does not allow WordPress to increase PHP memory.
The PHP memory limit must be manually increased by your hosting provider.
In this article, we hope you learned how to increase the PHP memory limit to fix the WordPress memory exhausted error.
If you enjoyed this article, subscribe to our YouTube channel for more WordPress video tutorials. please follows us on Twitter and Facebook.