DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

If you ever had error that reads “Allowed memory size of xxx bytes exhausted”, then you need to increase WordPress memory limit. This can be done very easily and may solve really frustrating problems.

Simply open your wp-config file, located at the root of your WordPress install, and paste the following code in it. Once saved, WordPress will be able to use as much memory as specified.

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

Thanks to Jeff Starr for the tip! By the way, did you checked out the new version of his book Digging into WordPress?


  1. Thanks, I’ve been looking for this little trick for about an hour now. Works perfectly =)

  2. Hello,

    Usually it could be like that but I don’t know why it’s not worked for me. Perhaps you may add some tips like could be add in the .htaccess with the line:

    php_value memory_limit 64M

    Or manually edited in php.ini if you’re running in shared hosting environment.

    Perhaps that could help.

  3. Thanks for this article, helped after much searching

  4. Where in the wp-config file should i add this code?

  5. Thx, just applied. But how to know which is the max you can assign and how can you test it ?

  6. Thanks.. it worked for me. 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *