How To Resolve Memory Exhausted Errors In WordPress Quickly

a person typing on a keyboard

Many WordPress users encounter memory exhausted errors that can hinder the performance of their websites. This guide will help you quickly resolve these issues, enabling your site to run smoothly. Memory exhausted errors typically indicate that your PHP scripts have exceeded the memory limit allocated by your server. Here’s how to fix them step by step.

First, check your error message. Most of the time, it will specify the maximum amount of memory that can be allocated. This information will let you know if you need to increase the memory limit or if there’s an underlying issue with your site that needs to be addressed. You can find this error message in your WordPress dashboard, in your email alerts, or in the error log generated by your hosting provider.

Next, you can increase the PHP memory limit by editing your wp-config.php file. You can access this file through a file manager in your hosting account or via an FTP client. Open the file and add the following line before the “That’s all, stop editing!” comment:

define('WP_MEMORY_LIMIT', '256M');

This code will raise your memory limit to 256 megabytes, which is usually sufficient for most websites. If you’re still experiencing issues after this change, you might want to try a larger limit, such as 512M. After making the change, save the file and reload your website to see if the error persists.

If increasing your memory limit does not resolve the issue, you might want to check your plugins and themes. Sometimes poorly coded or outdated plugins can consume too much memory and lead to exhaustion errors. Deactivate all your plugins initially to see if the error goes away. If it does, reactivate each plugin one by one to identify which one is causing the problem. If your theme is outdated, consider switching to a default theme temporarily to see if this resolves the issue.

Additionally, you can also modify your php.ini file if you have access to it through your hosting account. Look for the line that reads memory_limit and increase its value as needed. Here’s an example:

memory_limit = 256M

Don’t forget to save changes upon exiting the editor. If you don’t see any php.ini file, you can create one and upload it to your server.

For those using a cPanel, you can adjust your memory limit in the MultiPHP INI Editor. Simply select your domain and edit the memory limit value there. Save the changes and check your site again.

Lastly, contact your hosting provider. Sometimes memory issues could be related to server configuration. Your hosting provider may have set a limit that you cannot change on your own. They can assist you in identifying and resolving any server-related memory limitations.

By following these steps, you can effectively resolve memory exhausted errors in WordPress and improve your website’s performance!

Scroll to Top

Is Your WordPress Site Giving You Trouble?

Get the insider tips and tricks you need to keep your site running smoothly.