Fix Memory Exhausted Error in WordPress - Increase PHP Memory - Web Minto

Fix Memory Exhausted Error in WordPress – Increase PHP Memory

Free WordPress Tutorials for the Beginners


How to fix memory exhausted error in WordPress – increase PHP memory? If your WordPress site is encountering this error then this guide will help you to fix it easily.

Memory exhausted is one of the common errors occurs in WordPress website. It occurs because PHP memory need to increase from default memory size set in the web server. You can easily fix this error increasing PHP memory limit in the web server.

Cause of WordPress Memory Exhausted Error

Your WordPress blog is hosted in the web server and Web server need memory to run your blog or the application. Web server uses programming language called PHP. PHP Memory are sets to specific memory size e.g. 64MB or 256MB.

When your WordPress blog need more memory limit to execute than the default memory limit, your blog will encounter Memory Exhausted error.

Fatal error: Allowed memory size of 33554438 bytes exhausted (tried to allocate 2348611 bytes) in /dip777/xxx/public_html/wp-includes/plugin.php on line 21.

How to Increase PHP Memory Limit

You can increase PHP memory limit in wp-config.php which is located in the root folder of the web server. To access the wp-config.php file you need FTP client such as file FileZilla.

Connect FileZilla to your web server and double click on public_html folder where you will find wp-config.php file. Right click on wp-config.php file and click on View/Edit


Now, add the line of code below <?php tag and save it.

define(WP_MEMORY_LIMIT,256M );
500 Internal server error on WordPress

You will see the dialog box to upload the edited wp-config.php file back to the web server click on Yes button.

Now, the line of code added in wp-config.php that will increase PHP memory limit to 256MB from the default memory limit. Reload your WordPress blog and see whether the error resolve. If the error still exist then you need to contact your hosting provider to increase PHP memory limit from their side.

We hope this guide on how to fix memory exhausted error in WordPress : increase PHP memory is helped your to resolve the issue. You may also like to see guide on fatal error : maximum execution time exceeded

If you find this guide helpful, do not hesitate to share and follow us on facebook and twitter.