We have transferred numerous client websites, and sometimes a WordPress Memory Exhausted error shows up when activating a new plugin or doing some other task.
This could happen on batch actions or very large orders, sites with a lot of plugins, little memory, resource heavy plugins, or a combination of all of these. Usually the error looks like this:
We got an email from a user who was facing the same problem, so we decided to do a writeup on it because this is a common problem. The reason why this error shows up is because you exceed your default Memory Limit. There are numerous solutions for it, but in this article we will share the simplest one out of all.
Increase PHP Memory to 64MB
define( 'WP_MEMORY_LIMIT', '64M' );
Increase PHP Memory to 96MB
define( 'WP_MEMORY_LIMIT', '96M' );
Administration tasks require much memory than usual operation. When in the administration area, the memory can be increased or decreased from the WP_MEMORY_LIMIT by defining WP_MAX_MEMORY_LIMIT.
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
Please note, this has to be put before wp-settings.php inclusion.