WordPress Memory Exhausted Error
Exhausted memory error happens when a script of WordPress becomes exhausted because of limited memory. When this error occurs, a message will be shown on the screen with memory size and the error type.
Few examples of this WordPress Memory Exhausted Errors:
- allowed memory size of 33554432 bytes exhausted
- allowed memory size of bytes exhausted php
Solving the Memory Exhausted Error Issue
First of all, make sure your hosting plan is good enough for the size of your site. Let’s say you have a big WordPress site, with hundreds of posts and hundreds of unique visitors per day. If you host this kind of site on a basic and shared hosting plan, you will encounter this error very often. Make sure you have a powerful hosting plan.
Second, you can try to increase the memory limit
Editing wp-config.php file
To edit this file, you need access to your server via FTP. The file can be found directly in the root of your WordPress site.
Open the file in your favorite editor. At the very bottom, right before the line that says, “Happy Blogging”, add the following line:
define('WP_MEMORY_LIMIT', '1G');
WordPress memory may be handled differently, that’s why you need to set this in any case.
Editing your PHP.ini file
If you have access to the PHP.ini on your server, please look for the following setting and update it as follows:
memory_limit = 1G;
Editing your .htaccess file
To edit this file, you need access to your server via FTP. The file can be found directly at the root of your WordPress site.
Open the file in your favorite editor and add the following line at the top of it:
php_value memory_limit 1G