How to fix the exhausted memory error in WordPress

Aug 12, 2009 by     13 Comments    Posted under: Productivity, Technology

Today, like any other day a wordpress update comes out, is a relatively painless procedure thanks to Keith Dsouza of Techie Buzz’s awesome WordPress Automatic Upgrade plugin. If you don’t already have this one installed in your arsenal, stop reading this and go grab it. This is perhaps the best plugin for wordpress by far, as it saves countless headaches of backing up the db, exporting, installing the new wp version, etc. etc. Thanks Keith!

October 13, 2010 Update: This article specifically applies to WordPress 2.x and lower, but the methodology still functions in WordPress 3.x. To fix the exhausted memory error in WordPress 3.x, follow the steps below, but this time, you’ll be modifying the wp-config file.

Open this file in your editor of choice (I use Dreamweaver)

Just after the < ? php tag, and before the / / **MySQL settings ** / / text insert:

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

Obviously, you can change this ’64M’ to any variable of 8 you’d like.

Right. Now that you’ve got Keith’s plugin installed, and upgrading you wordpress install is literally as easy as 6 or so clicks, you may or may not receive the dreaded ‘memory exhausted on line xyz…bla bla bla’ error. The error may refer to the kses.php file, class-simplepie.php file or any number of other variables. In your dashboard, you’ll most likely see something like this:

Oh Noes!

Yikes! That looks pretty nasty. But fear not, Captain O’ WordPress, it’s a relatively easy fix. Basically what’s going on here is that the server your blog is hosted on isn’t giving you enough juice to power everything that’s going on in your dashboard. Or rather, I should say, your wordpress installation isn’t telling the server to give you the required juice to make everything play nicey nice. Let’s go ahead and fix that bugger, shall we?

To fix the exhausted memory error:

1. Log in to your FTP client. I use Cyberduck to manage mine, but any FTP client will do the trick.

2. Locate the wp-settings.php file. In my installation, it’s hanging out in the main directory.

wp-settings

3. Download this file to your desktop, or anywhere else you want to store it, just remember where you’ve put it.

4. Open your code editor. I use dreamweaver, but as with the FTP client, any text editing software (even the one included with your OS) will do the trick.

5. On line 13 (shown below), you should see the text – define (‘WP_MEMORY_LIMIT’ , ‘32M’ ). Ah ha! Exhausted memory, memory limit….see where we’re headed with this?

32M-limit

6. Change this variable to anything higher than 32mb. I like to be on the safe side, and ask the server for double what the standard wordpress install calls for, and up it to 64mb.

64M-limit

7. Save the file

8. Upload the file back to its initial location

Click that dashboard button again inside your wordpress installation, et viola! Pretty text and all other goodies returned.

If you’re still having the exhausted memory error after following the procedures above, try upping the memory limit to 128mb. However, keep in mind, with 128mb you’re really pushing the limit on what your host will deem as ‘acceptable’ behavior from the one of perhaps hundreds of sites that are sharing the server with you. I’d recommend testing with 128mb, and upon ensuring this memory allocation solves your problem, try backing the usage down until you get the error again. If problems persist, you might want to open a support ticket with your host.

Problems or questions? Leave a comment below and I’ll do my best to help!

  • http://www.DigBands.com/emo Emo

    That’s a helpful article in fixing errors in wordpress. I can use those tips when I encounter errors like it.

  • http://www.DigBands.com/emo Emo

    That’s a helpful article in fixing errors in wordpress. I can use those tips when I encounter errors like it.

  • http://gheo.info/ gheo

    I just did my wordpress upgrade, and had this exact error. Thanks for the walk through, and clearly explained steps. I had my dashboard back in no time. Thanks again!

  • http://gheo.info/ gheo

    I just did my wordpress upgrade, and had this exact error. Thanks for the walk through, and clearly explained steps. I had my dashboard back in no time. Thanks again!

  • http://gamingweapons.com/ Chris @ Gaming Weapons

    I wish I’d found this tip earlier, I had this exact same problem after the last upgarde and again the other day when I installed a new plugin. I was running around the server changing any php.ini files I could find. Didn’t realise it was as simple as this. Thanks!

  • http://gamingweapons.com Chris @ Gaming Weapons

    I wish I’d found this tip earlier, I had this exact same problem after the last upgarde and again the other day when I installed a new plugin. I was running around the server changing any php.ini files I could find. Didn’t realise it was as simple as this. Thanks!

  • BloggerDude

    I don’t know If I said it already but …Excellent site, keep up the good work. I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your blog. Thanks, :)

    A definite great read….

  • http://Yourwebsite BloggerDude

    I don’t know If I said it already but …Excellent site, keep up the good work. I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your blog. Thanks, :)

    A definite great read….

  • http://www.archcityhomes.com Karen Goodman

    This was exactly what I needed. I was trying to install a real estate plugin, Market Location Explorer, and got the same error. My website designer pointed me to this article. I am SO non-techie and would never have tried to do this myself if you hadn’t written it in a way that anyone could do it.

    Thanks!

  • http://www.archcityhomes.com Karen Goodman

    This was exactly what I needed. I was trying to install a real estate plugin, Market Location Explorer, and got the same error. My website designer pointed me to this article. I am SO non-techie and would never have tried to do this myself if you hadn’t written it in a way that anyone could do it.

    Thanks!

  • http://www.igotasti.com Jefferis

    Hey Dan, is this fix only for WP less than 3.0? I don’t have a memory definition in my wp-settings file, only in my config file.

  • http://www.turnthescrew.com Dan Taylor

    Good call Jefferis! You are correct – the method over applied to WordPress 2.x.

    To up your memory limit in 3.x – insert:

    define(‘WP_MEMORY_LIMIT’, ’64M’);

    just before the <?php tag at the very top of your wp-config file. This should be inserted before
    // **MySQL settings ** //

    Thanks for the catch, and I'll update the post accordingly.

  • http://www.turnthescrew.com Dan Taylor

    Good call Jefferis! You are correct – the method over applied to WordPress 2.x.

    To up your memory limit in 3.x – insert:

    define(‘WP_MEMORY_LIMIT’, ’64M’);

    just before the <?php tag at the very top of your wp-config file. This should be inserted before
    // **MySQL settings ** //

    Thanks for the catch, and I'll update the post accordingly.

Latest Tweets

Video

flickr

Blue OrchidEmpty squares at empty tablesShowtimeDark ReflectionA Small WorldHoly Snail MailSwissGuardGoldenOpulanceGolden ArchesThe Main StageCircledAfterglowMagic LightPavedLast LightRound and RoundOculus