1. Home
  2. Website
  3. Wordpress
  4. WordPress: How to fix Memory Exhausted error ?

WordPress: How to fix Memory Exhausted error ?

This article provides you with steps to fix the Memory exhausted error in WordPress.

 

 

What is WordPress Memory Exhausted Error?

 

WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server for it to function properly.

Web servers are just like any other computer. They need memory to efficiently run multiple applications at the same time. Server administrators allocate specific memory size to different applications including PHP.

When your WordPress code requires more memory than the default allocated memory, you get to see this error.

 

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home/xxx/public_html/wp-includes/plugin.php on line xxx 

 

Memory exhausted error displayed on a WordPress site

By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high enough.

Having said that, let’s see how to easily increase PHP memory limit in WordPress to avoid memory exhausted error.

 

 

Increase WP PHP Memory Limit in WordPress

 

 

Step 1– Login to cPanel

  • Please see our article on logging into cPanel here.

 

 

Step 2 – Click on File Manager under your Files section.

 

 

Step 3 – Edit your wp-config.php file

 

 

Step 4 Paste this code in wp-config.php

  • You need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’
define( 'WP_MEMORY_LIMIT', '256M' );

 

Updated on August 31, 2023

Was this article helpful?

Related Articles