Have you encountered an ‘Allowed Memory Size Exhausted’ error message popup in WordPress while developing? If yes, then don’t worry nothing bad has happened. The exhaustion of allocated memory is a common WP error. There can be many reasons behind the depletion of your pre-allocated WordPress memory. For example, if you were activating a plugin that had a size than expected.
When met with such a scenario, you can easily remedy it by adding more PHP memory to WordPress. To increase the PHP memory limit in WordPress, follow the steps below:
The first thing you want to do is to make edits in the wp-config.php file of your WordPress website. Your WordPress PHP configuration file is located on your website’s root folder.
The second step would be to add the following code to your wp-config.php file to increase the PHP memory limit.
The code displayed above will help you to increase the PHP memory limit to 64 MB, which shall be sufficient for some development operation. Please note that every WP site has a different memory need, thus you would need to select your storage limit. After you have made the changes to your wp-config.php file, press saves and upload your configuration file back onto your hosting server.
And voila your mission to increase the PHP memory limit is a success. As a result, the ‘Allowed Memory Size Exhausted’ error message should disappear now.
Please remember that the above solution will only work if you have server access. What that means is that you can remotely increase the size of allocated memory to your server. If even after correctly following the procedure mentioned above, the memory exhaustion problem persists, then you must reach out to your hosting provider. You must ask your web hosting provider to either increase the PHP memory limit themselves or give you access to do so yourself.