Wordpress Tips  

Is your wordpress two slow?  did you get an error that display not enough memory to run current script?did you get error like this one?

Fatal error: Allowed memory size of 8388608 bytes exhausted.

or PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 6233929 bytes) in /home/…/press/wp-includes/cache.php on line 330

or Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 368640 bytes) in /wordpress/wp-includes/class-simplepie.php on line 9575

Then you are lucky to be here! Here are four solution to increase your WordPress memory

  1. If you have access to your PHP.ini file, change the line in PHP.iniIf your line shows 32M try 64M or even 128M:
    memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
  2. If you don’t have access to PHP.ini try adding this to an .htaccess file:

    php_value memory_limit 64M
  3. Try adding this line to your wp-config.php file:Increasing memory allocated to PHP
    define('WP_MEMORY_LIMIT', '64M');
  4. Talk to your host!

Update: Monitor real WordPress memory usage:

do you know how much memory your WordPress needed? how much is your pick WordPress memory usage?
If all need memory for your wordpress is 10M. Why you should be worry to set it to 64M? Thats true I found My pick memory usage was just 8M! That is why wordpress default memory usage is only 32M which is more than enough.

Here are two plugin that let you to monitor and know your Wordpress current and pick memory usage.
try them before changing your WordPress memory usage to higher value.

  • http://wordpress.org/extend/plugins/wp-memory-usage/
    Simple and light. Show up the PHP version, memory limit and current memory usage in the dashboard and admin footer. You can now simple measure the requirements of your plugins and language files
  • http://wordpress.org/extend/plugins/tpc-memory-usage/
    More advanced with more report. view the current and peak memory usage of the application. This is extremely helpful when testing new plugins, or if there are a lot of modifications, plugins, or large language files. As of version 0.4, administrators now have the ability to view detailed system information about their web server, MySQL, PHP, and WordPress software. (Requires PHP5)

After Using above plugin I noticed my PHP memory is set to 128M and my max  WordPress memory is set to 32M

Note: If you add  define(‘WP_MEMORY_LIMIT’, ‘64M’); to the end of WP-config.php it do not work. You have to add it to at top of wp-config.php file (at root of your wordpress directory). here is the final result:

As you see in above screen-shot, My WordPress Memory  limit is set to 64M which is more than enough.

Here is how modified wp-config looks like:

If you are wonder what are rest of the extra gray lines , continue reading simple ways to make youe wordpress faster

Try same yourself. In nutshell you need to do following steps:

  1. Check your current  memory by using above  plugins
  2. set php.ini memory to higher if needed.
  3. Set WordPress Memory to a value equal or less that php.ini memory
  4. Check your change is working or not ( by using  above plugins)

If still you had difficulty let me know to help you.

  • Share/Bookmark

Add your comment


  1. kobizeit
    April 14, 2010
    11:58 am

    Thanks, your solution 3 worked for me.


  2. Andy
    April 14, 2010
    12:46 pm

    Hello kobizeit,

    I’m glad to hear it helped your wordpress enjoying more memory.

    Andy

  3. I actually got some info here, See here How to increase wordpress memory limit, I tried number #3, very helpful. Thank you.


  4. Eyl
    July 6, 2010
    3:43 am

    thanks, my meory limit is changed to 64MB but the fatal error still appear. im using wordpress 3.0 with mystique theme.


  5. Andy
    July 10, 2010
    4:35 pm

    WordPress Works well with 32MB. yours is great memory. problem can be from incompatible plugins with theme.Try deactivating all plugins


  6. Carlo
    August 14, 2010
    1:34 pm

    Great post bro!
    My compliments.
    A blank page also indicate to increase your php memory limit, right?

    Cheers


  7. Andy
    August 18, 2010
    8:46 am

    Yes Carlo! blank page also indicate to increase your php memory limit.

RSS feed for comments on this post. TrackBack URL

Add your comment.





( DoFollow )

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home | WordPress | Themes | Plugins | Download | Forum | Freelance | Resume | Projects | Service | Contact | About
Copyright 2009 Hecode.com