WP-Optimize Database Cleanup and Optimization Plugin for WordPress

wp-optimize logo

Download WP-OptimizeLatest version hosted at GitHub Official Plugin Repository

Preface

I use WordPress solutions in a day to day basis. WordPress comes with a very extensible framework that allows you to add comprehensive and powerful functionality to your Blog system. WP-Optimize plugin is written to simplify your daily WordPress works simpler. WP-Optimize is a WordPress 3.8x database cleanup and optimization tool. It doesn’t need PhpMyAdmin to optimize your database tables. It allows you to remove post revisions, comments in the spam queue, un-approved comments, and many other junk within few clicks.

Advertisement

How this could help you?

  • Every time you save a new post or pages, WordPress creates a revision of that post or page. If you edit a post 6 times you might have 5 copy of that post as revisions. Imagine if your post or pages are long and big. It’s a huge number of bytes that is on your MySQL overhead. Now WP-Optimize allows you to optimize and shrink your posts table by removing not necessary post revisions from the database. As example, if you have a post which is approximately 100KB data and you have 5 revisions of that post, the total space wasted is about 500KB. And if you have 100 posts similar to it, you might have 50MB database space wasted.
  • Similar to the scenario described above, there might be thousands of spams and un-approved comments in your comments table, WP-Optimize can clean and remove those in a single click
  • WP-Optimize reports which database tables have overhead and wasted spaces also it allows you to shrink and get rid of those wasted spaces

Features:

MAJOR FEATURES:

  • Removal of stale post revisions
  • Removal of stale unapproved and spam comments
  • Removal of trshed comments
  • Mobile device friendly, now you can optimize your site on the go
  • Removal of all trackbacks and pingbacks
  • Cleaning up auto draft posts
  • Removal of transient options
  • Clear out the post trash
  • Automatic cleanup of all the integrated options (also uses retention if enabled)
  • Ability to keep selected number of weeks data when cleaning up
  • Option to add or remove link on wp admin bar.
  • Enable/Disable weekly schedules of optimization
  • Apply native WordPress MySql optimize commands on your database tables without phpMyAdmin or any manual query.
  • Display Database table statistics. Shows how much space can be optimized and how much space has been cleared.
  • Enabled for Administrators only.

All the potentially dangerous clean up options are marked RED.

Advertisement

When you use this plugin for the first time or just updated to major version, make a backup of your database. It is always the best practice to make a database backup before using this program first time.

Requirements:

  • Requires PHP 5.1.xx and MySQL 5.1.xxx
  • It Requires WordPress version 3.x and higher. Tested with 3.8beta
  • InnoDB Table formats not supported yet thus it would not optimize those table types

Installation:

  • Unzip the archive into your hard drive.
  • Upload the folder to your wp-content/plugins folder on your web host.
  • Login to your dashboard and activate the plugin via activate option.
  • The menu item is – WP-Optimize ; can be found on your left side bar.

Usage:

  • Select the WP-Optimize item under WP Admin.
  • Select the actions you want to perform.
  • Click on Process button.
  • Click on Settings to setup some options like what would you like to clean automatically on a period of time.

Screen Shots:

screenshot-1

Main Screen

screenshot-2

Settings Screen

screenshot-3

Tables View

screenshot-4

Mobile View 1

screenshot-5

Mobile View 2

Translators

FAQ

Can you help me restore my database?

No I can’t. Please make a backup of your entire database before using this Plugin for the first time. Also backup your database when you upgrade to a MAJOR NEW version (for example – v0.9.8 to 1.5.5 ).

Everytime I clear transient options, it comes back automatically

WordPress automatically creates transient options. It is pretty difficult to completley get rid of it. This is why everytime you clean transient options, you will notice new transient options has been created. My best advice would be clear the transient options on a schedule. So, for example it may create 50 transient option in a week and you clear it weekly so the next 50 transient option comes in. Rather than having 100 transient option, you will have 50 per week.

Optimization does not have any effect on database / it is not optimizing the database

Some of the shared web hosting company does not allow scripts to run OPTIMIZE command via SQL statements. If you are hosted with these web hosts, the optimize action will not be able to optimize your database. Please consult your web hosting company regarding this matter.

I am having error – Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource …  

  • Upgrade/Update your WordPress to at least 3.5
  • Upgrade/Update your WP-Optimize plugin
  • Upgrade your PHP to at least 5.1.xx
  • Upgrade your MySql to at least MySql 5.1.xx

Related Resources:

This is a primary version of the plugin so any feedback here would be highly appreciated. In addition to that you can post your feature/bugs or suggestions at GitHub.

Did this plugin helped you out?

Would you like to donate an amount or just buy me a coffee?
WP-Optimize Donation

289 Comments WP-Optimize Database Cleanup and Optimization Plugin for WordPress

  1. Dorian

    Is it possible to run wp-optimize with a cron job? (a real cron job, not wp_cron) My searches on this topic have come up emtpy. Please advise. Thanks.

  2. lautreamont

    Just now your plugin deleted my wp_usermeta and I was unable to log in to my account. My luck that was on my local comp and I have backup. Not complaining just informing you.

    1. Ruhani Rabin

      Hi there, thanks for letting me know. But the plugin does not have a code that can touch usermeta table.. so how it will be able to delete it? please check with a fresh local install and try it without any other plugin installed.:)

  3. Mariangela

    Hi, it should be a great plugin but could I know the right way to compile it?In the past I used plugin that have deleted important file and I have my fears now!thanks a lot

  4. Mike

    My _options table always says “need to optimize”. I optimize using this plugin and also php myadmin. I can’t seem to make it go away. Any tips?

    1. Ruhani Rabin

      Please backup your complete database and try to run repair onto that options table. It may fix the issue. It can also be an issue about the DB format. But as i said.. please backup the DB first.

  5. Rafael R. de Lima

    I would like to clarify a doubt. If this plugin removes the table “wp-options” settings of uninstalled plugins, because when a plugin is reinstalled the old settings reappear?

  6. Ingar Sørensen

    You may want to free up some space but for most people it is most important that the page loads quickly. I’m sure my site was much faster after I Installing wp-optimize – Thank you so much!

  7. Pilot

    Hi, is it possible to schedule WP Optimize to optimize the DB tables say on a weekly basis? Or is this not adviseable?

  8. Szemcse

    Hi!
    Error: The actual loaded translation content does not match the textdomain: wp_optimize
    Expect, that any text you translate will not occure as long as the textdomain is mismatching!
    This is a coding issue at the source files you try to translate, please contact the original Author and explain this mismatch.Warning: The actual loaded translation content contains mixed textdomains and is not pure translateable within one textdomain.
    It seems, that there is code contained extracted out of other plugins, themes or widgets and used by copy & paste inside some source files.
    The relevant comments: wp-optimize

    1. Szemcse

      Hello The downloadable version of the Spanish language file name was not good. For some reason, this edited, but once correctly renamed wp_optimize-es_ES.po file: wp-optimize-es_ES.po the issue is resolved.

  9. Christopher

    I upgraded to the latest version and it appears to have upgraded it’s self by deleting it self.  It’s not listed in the Plug-ins list ?

  10. Zulugogogo

    Any thought to automating the optimize DB tables? I have found significant speed change running this every few days, so would be nice to automate

  11. Chall

    I’ve been using WP Optimize on one of my sites for a year or more and love it. However, I was just getting ready to install the plugin on a site I maintain and I discovered that you’re dropped the security feature that allows the easy renaming of user “admin.” Why have you dropped this? It’s a pretty handy feature.

    1. Ruhani Rabin

      Hi Chall, Actually I dropped it because it may create some confusion when you want to create author based URL. It has something to do with author meta tags which I need to sort out. Thanks!

    2. Ruhani Rabin

      Hi Chall, Actually I dropped it because it may create some confusion when you want to create author based URL. It has something to do with author meta tags which I need to sort out. Thanks!

  12. DynaPixels

    This plugin really helped me to reduce from my database 104 MB to 84 MB

    Really thankfull to you. Keep up the good work.

  13. Dennis

    Hi!
    Thanks for the cool WP-Optimize WordPress plugin. Now, the version 0.9.4 is out and I’m wondering, whether it will work on my site. At the moment I’m using WP-Optimize 0.9.2, that works with my MySQL 5.0.51a database. But does WP-Optimize 0.9.4 REALLY require MySQL 5.1.x? My webspace provider will NOT update to MySQL 5.1.x – so what can I do? Should I try it anyway or better stick to 0.9.2?Thanks in advance.Regards,Dennis

  14. faddah

    hi – i use your plug-in and like it. however, you just released a new, updated version of this plug-in, yet i can’t find a specific change list here for this new version. do you have posted here, and could you direct me to, please, a separate change list page for the versions of this plug-in, especially the latest version, that shows me exactly what has been fixed/changed/updated/added in this latest, current version? it would be most appreciated. thank you.

  15. Guest

    Very Very nice plugin. I for one however would love for the plugin to calculate the of the database as a whole with all tables. Your plugin currently calculates each tables size, and I can add these up but I would love for you to have a notice of the current database total size.

      1. Ruhani Rabin

        I am currently investigating the issue.. whether possible or not. I will update the plugin in the mean time.. (will update again when i find a solution for innoDB)

  16. Marc_taylor

    I ran the plug in now all I see on my home page is;
    “Error establishing a database connection”

    How do I fix this?

    1. Ruhani Rabin

      .. it merely optimize such as phpMyAdmin.. check your other plugins first then .. try to use phpMyAdmin to look at your database.. if you want to disable the plugin .. you need to delete the folder from /wp-content/plugins directory

  17. Imraan

    i am having problem with this plugin. It is showing error on these 3

    Combine images into CSS sprites
    Leverage browser cachingDefer parsing of JavaScripthow to fix them ? Please guide me.

  18. Happy

    I heard about this plugin a while go but, lost the name of it. I’m so glad I found it again! It is going on all my blogs!

  19. Anthony Butler

    Great plugin – especially for getting rid of the dreaded auto draft posts. I have three blogs in the one database, using table prefixs. This seems to cause WP Optimize to ‘forget’ that it has optimised the tables as soon as it has done so. Is this a WP Optmize of MySQL problem?

    Anthony

    1. Ruhani Rabin

      Hi Anthony WPO directly talks to MySQL to get back the information to display .. you may want to run the optimization through PhpMyAdmin and check whether it acts in the same way. WPO works almost exactly the same way PhpMyAdmin works.. so PhpMyAdmin would act also forgotten the optimization .. in that case it is a MySQL problem.. you can get back to me on this :)

  20. how to sell a business

    As a rule, plugin do a special kinds of work. This optimization plugin removes post revisions, spams and also optimize your database tables. It is a very useful discussion in this regard.

  21. salvage yards

    Everyone working with database management would like to optimize database tables and remove post revisions, spams with plugins. It is very useful and informative discussion on the subject. I appreciate the hard work.

  22. free online dating

    I am extremely glad to learn about the wp-optimize database cleanup and optimization plugin for wordPress. It is good to notice that this plugin removes post revisions, spams and optimize database tables. It is an excellent work.

  23. Armiliansyah

    Hi Rabin,
    Thanks for the great plugins. However, after I used it to optimize my WP sites, somehow I can’t upload images and i can’t install other plugins. It said “failed to create wp-content…”. Now I can’t put images to my WP sites. Can you please advise what should I do to fix this?

    Thanks in advance

    1. Ruhani Rabin

      WP Optimize doesn’t touch any settings of WP neigther the folders. Please consult your webhosting provider or check what other plugins have you installed.. Technically WPO cannot create this problem..

  24. Brian

    Yes. WP Optimize is handy and smart. But why is it a unique drop down menu? A menu interface is precious. A tool is a tool. I’m surprised WP Optimize bullied its own screen real estate.

  25. Dapadoo Blogs

    Hi, the plugin works but here are still security problem when using WP 3.1 multi-site. All admins even the ones that aren’t super admins can see and run WP Optimize from their blogs dashboards. They can see all the pages of all blog owners including the main blog.

    1. Ruhani Rabin

      Thanks for the info but currently it is designed for the admins to see .. “Admins” and “Site Owner Admins” will be able to see .. I will take a look but it will take a long time because I am not catering for WP Multisites currently..

    2. Dapadoo Blogs

      Ruhani, with the new update to wordpress to WP 3.1 came some interesting changes. One of them is 2 dashboards for super admins. One is “Site Admin” the other is “Network Admin” I had to deactivate all my plugins and the reactivate them . I found some thing very interesting.

      WP Optimize shows up on the plugins of both dashboards. When I activated it on just the “Site Admin” plugins page other users on the multi-site could not see WP-Optimize options. So I’m happy to report at this time the WP-Optimize is working on WP 3.1 Multi-site with Buddy Press and bbpress acivated. If I come across any plugins that when activated cause WP-Optimiz to cause a problem I’ll let you know.

  26. zonebattler

    Hi, I just realized that the WP Optimize configuration screen is accessible not only for admis, but also for authors. This seems to be a potential security hazard since it would allow users with restricted rights to change the username of others! I think that the use of WP Optimize should be granted to admins only.

  27. Elias Sarantopoulos

    Ruhani,
    First of all thank you for this great plugin you have created and shared with us, it’s a gem! Quick question, do you think it will support 3.1? I run two sites and in both sites the plugin has disappeared from the menu. Any thoughts? Thank you!

    1. Ruhani Rabin

      Hi Elias, I am assuming you upgraded to new version BUT you didn’t read the included readme.txt file =)
      WP-Optimize has it’s own menu Icon now and it was already (Older version already supports 3.1) supported for 3.1.. The menu item didn’t disappeared .. take a look here .. http://j.mp/i2rfDm and visit the plugin at the WP repository.. =)

    1. Ruhani Rabin

      I will keep this in mind .. hopefully someone would send me a tip to get all the unused tags.. I am afraid it might generate too many calls to mysql DB..

  28. No

    This great plugin removes “revisions” but i checked my DB after the cleanup and i found records where “post_status”=”auto-draft”. This can be a new feature in the next version.

  29. Chuck

    Great plugin, but I’m getting this message. Any suggestions? Thank you.

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:dev.alarmsearch.comwordpresswp-contentpluginswp-optimizewp-optimize-admin.php on line 343
    Table Size Status Space Save
    Table Size Status Space Save
    Optimization Results:

    Total Space Saved: 0 Kb

    1. Julian Gieseke

      what is your database-name? looks like the plugin is buggy with tables which have “-” in its name. (i know using “-” in var-, db- or tablenames is bad practice, but sometimes your hoster makes something like “userid-customname”…)

      @Ruhani please fix your plugin, add backticks to all database-queries. for this particular problem, its line 341 in wp-optimize-admin.php, replace existing line with this:
      $local_query = ‘SHOW TABLE STATUS FROM `’. DB_NAME.’`’;
      (pluginversion: 0.8.0)

      then it should work.

  30. Levyjs

    Just tried it on newest WP update as of Jan 16 2011 and it cleaned up old post revisions, optimized database tables. So far it works great. Thanks for the great plugin to make things run smoothly without clutter.

  31. Jürgen

    Works.
    But Maybe you should move it from the Dashboard Submenu to Tools submenu. I think it makes more sense.
    And maybe you should adda new version to make clear that it works with 3.04 ass well

  32. Vivek

    I am getting following error message;

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in domain.com/wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 343

    It was working fine, i see error after installing plugin ‘smf bridge’, I tried disabling that plugin and problem gone, so its in direct conflict with the plugin. Please correct it in next fix.

    Thanks.

  33. Celina

    I tried changing my username from admin to something else, then logged out to try logging in with the new account. It really worked, but for some reason I have lost all my admin privileges! I am still Administrator and yet I cannot touch anything. My plugins that are not network activated are also deactivated.

    So frustrating. How can I fix this? It’s a major problem as my website content is blanked out. Please help, I would greatly appreciate it!

  34. Leo

    Great plug-in. I just used it on my site and it did everything it was supposed to. Changed username and deleted revisions… ;o) Thank You.

  35. Ruhani Rabin

    This plugin won't be able to make those type of problems. Check your permalinks structure, open your comments for that post etc. Also please provide a direct link to the problem. This plugin doesn't interfere with any wordpress settings.

  36. Kalian

    1. I have “_” in db name, but my hosting automaticly creates names like user_dbname. Can I change something in plugin code to fix it?
    2. MySQL 5.1.47
    3. PHP 5.2.13

  37. Kalian

    On WP 3.0 have an error:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 343

  38. Gwilson9564

    I tried using it on my WP3 site and it crashed the site. I had to restore from my backup files. Not sure what happened.

  39. Stehanov Peter

    WARNING! It's a bug report!

    Be careful because when you use more different WordPress in same database (or anything else) it'll be “optimize” all of the table in that database!

    Developer(s): Fix it and keep up your good work! :)

    Peter

  40. air jordan 9

    Here elaborates the matter not only extensively but also detailly .I support the
    write’s unique point.It is useful and benefit to your daily life.You can go those
    sits to know more relate things.They are strongly recommended by friends.Personally!
    http://www.you-rselfas.com

  41. air max shoes

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

  42. Ruhani Rabin

    Yes I know about it but it makes more problems than solving it .. and the data chunk is not that big .. till i find a proper solution i will keep it how it is now.

  43. air force one shoes

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!

  44. Crazy Girl

    Long time I am using your plugin and I am quite happy. But today I discovered some thing what you missed regarding revisions in your plugin. For any revision there will be even entries in postmeta and term_relationships tables. Your plugin only deletes the revisions in posts table.
    Could you update your plugin so that all relevant revision entries in the database tables will be deleted?
    Second question: How do I get rid of the other revision entries in postmeta and terms_relationship tables when no post revisions are existing anymore? Any idea?

  45. Crazy Girl

    Long time I am using your plugin and I am quite happy. But today I discovered some thing what you missed regarding revisions in your plugin. For any revision there will be even entries in postmeta and term_relationships tables. Your plugin only deletes the revisions in posts table.
    Could you update your plugin so that all relevant revision entries in the database tables will be deleted?
    Second question: How do I get rid of the other revision entries in postmeta and terms_relationship tables when no post revisions are existing anymore? Any idea?

  46. Ivan

    Hi

    I get this error (WP 2.9.2):
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/MYWEBSITE.dk/wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 343

    Any idea?

    Best regards and tnx
    // Ivan

  47. João

    Hi,
    Great idea and seems well implemented, but there's something which is not clear to me. I have more than one blog using the same database (with different prefixes on the tables). Shouldn't WP-Optimize only show (and act upon) the tables of the blog from which dashboard it's being called?

  48. royalmice

    Been using the plugin for some time now and very satisfied.
    I would like to suggest if possible to automate this. I have a autoblog farm of about 50 blogs, and having to go to each of them to run the optemising takes time, and i do it maybe ones a week.

    It would be great if this optimization process can be scheduled to run say daily . Maybe a cron job or something.

    Just my 2cent worth

  49. twincascos

    Hello ruhani,
    just wanted to say thanx for the plugin, saves me a few minutes.
    I wonder if there's a way to schedule it to do a weekly cleaning?
    Also echo scottwyden's comment bellow, merge with WP-DBManager and we're laughing.

  50. gigi

    Hello, i like to add the total space information.

    i would like to add this lines in your next version.

    in line 351 add line: $total_gigi+=$total;
    in line 399 add line: <?php $total_gigi = round ($total_gigi,3);?>
    in line 412 add line:

    <?php _e('Total space:', 'wp-optimize'); ?> <?php echo $total_gigi?> Kb

  51. marlin

    Hey Rabin
    Thanks for this great plugin this is must use plugin for people like me who dont want to mess with phpmyadmin that always scared that something will surely go wrong.
    Thanks again

  52. marlin

    Hey Rabin
    Thanks for this great plugin this is must use plugin for people like me who dont want to mess with phpmyadmin that always scared that something will surely go wrong.
    Thanks again

  53. Wordpress Theme Design

    The WordPress Development Team at Xieno has acquired a growth along with the growth of WordPress itself. Our team is capable of providing almost any kind of solution, possible, in WordPress. Despite of its powerful Bloging opportunity our WordPress portfolio is consist of eCommerce Solutions, Photo Gallery, Social Networking, Link Directory, CMS enabled Informative Portal etc.

  54. Ruhani Rabin

    Mia this plugin works as same as phpMyAdmin .. so it should work regardless
    wordpress versions.. but for the sake of safety .. why not backup your
    database also test is out on your local machine :)

  55. MiaZoe

    Hi Ruhani , this is a great plugin ( Im quite new to all things WordPress :D ) – and I just have 1 question : How compatible is this now to WP 2.9 ? [ I dont want to cause brain damage to my new version :D ] . Your response is greatly appreciated . Thank you :)

  56. Hispania

    hey, great plugin. I've uploaded to my blog and doing quite well but I would put it in Spanish, do not you have the file. Po to translate to my language?

  57. Alessia Heartilly

    Good morning,
    I'm getting this error with this plugin:
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/amazingreaders.net/public_html/wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 343; I tried to optimize, but of course it doesn't work.
    I'm using WordPress 2.8.5 and the last version of the plugin. Is there some way to solve the problem? Thanks!

  58. Ruhani Rabin

    Yup Michael, I've just removed the code for POST META cleanup. Hopefully it
    will start working like it does before .. It used to be a flawless plugin..
    Please Get the update once it is available at the WP repository.

  59. Michael

    It's good that it cleans out old metadata, but it seems like it also cleans valid metadata for the actual post? That's a huge problem when working with thumbnails, as it can't retrieve the thumbnail URL any longer when metadata is gone. Bug maby?

  60. jaume69

    Hi,I have seen that with the latest version of WordPress 2.9.6 there is a problem. In particular,when you put to optimize:Remove all Post revisions,after is the blank screen.With the other options does not pass.
    At best only problem mine.
    Thanks.

  61. jaume69

    Hi,I have seen that with the latest version of WordPress 2.9.6 there is a problem. In particular,when you put to optimize:Remove all Post revisions,after is the blank screen.With the other options does not pass.
    At best only problem mine.
    Thanks.

  62. Ruhani Rabin

    This could be your shared hosting problem even though I've tested with 5 different shared hosting providers, still no memory problems, unless you are using some other plugin which is blocking most of your allocated memory .. I've added the feature to clean up the post meta table on the 0.7.0 version of the plugin .. which requires slightly more memory but it is pretty low requirement .. please check your server logs and php error logs.. and let me know ..

  63. Aurelian

    Hey there,

    I thought this plugin might help me but it didn't. I had PhotoJar installed and lost all the pictures on my website after the optimization. Do you have any idea on how to fix this?! I really wrecked up my things and i really need to fix it somehow. Did it save any backup or anything? Thank you.

  64. JC

    I'll second that. After upgrading to 2.86 wp-optimize no longer functions – it dies with memory allocation errors.

  65. 小闇

    I download the updated files before a moment.
    But it still does not work.
    In the previous reply, you said that the plugin must have mysql 5.1 and php 5.3.x, however, I can only use mysql 5.0 and 5.2.6.
    I think it is the reason why I cannot use the plugin.

  66. Ruhani Rabin

    I think the problem is with your mysql server upgrade.. You didn't mention the mysql server running. Also I did a test with 2.8.6 and found out it is working. Please check mysql version. for my test it was Apache 2.2, PHP 5.3, Mysql 5.1.

  67. Ruhani Rabin

    Just now I was testing with 2.8.6 and found out that the total number of
    kilobytes is not displaying correctly (empty).. But the plugin does the
    operations successfully ..

    I'm gonna take a deep look into it .. [EDIT]I've did some minor changes and it is fine now

    In the mean time, any tips/helps would be highly appreciated :)

  68. sociolingo

    Have you tested it out with the latest upgrade of WP – 2.8.6? it seemed a lot of things didn't work after 2.7 went to 2.8.

  69. 小闇

    Yesterday, I upgraded my MySQL in my host server.
    After the installation, I check my website, it is OK.
    But I found that there is a problem with WP-optimize.
    The picture with that problem: http://lh3.ggpht.com/_u_QFkzlEW20/Sv0ZFffgPFI/A

    As you see, there is a warning on “wp-optimize-admin.php”
    I don't know where is the problem is.
    So, I try to re-install the plugin, but it cannot recover.

    What's wrong with the plugin? (I am using WP version 2.8.6)
    Thank you to listen my questions.

  70. gombile

    so i not need to login to PhpMyAdmin again to optimize my database table, thanks for your great plugin :)

  71. Zhu

    Would have been perfect… except that the plugin deleted all my drafts (not the auto-save, the drafts) in my scheduled posts. Ouch!

  72. Tom

    I've got three different WordPress sites, all the latest version. On one of them though, it seems to work, but the list of tables isn't shown. I only see the two grey heading bars.

    I tried deactivating/reinstalling but that doesn't help. What could be wrong here?

  73. Yohan Perera

    I tried it in my blog. Results were superb. I backed up my database as precaution, but the plugin optimized the core tables without causing any damage to the database.Thanks for the hard work.

  74. John

    excellent plugin, works perfectly in wordpress 2.65

    would be useful if this could be scheduled to run automatically every day, or every few hours as i really notice a speed increase browsing my site after running wp-optimize.

    thanks for the great plugin!

  75. wwday3

    One more request. Could you add the ability to clean up old RSS stored in the options table? That would be a great way to avoid “Magpie bloat”. I'm thinking maybe cleaning up RSS hash more than xx number of days old (select 20, 60, 90, whatever).

    Thanks

  76. wwday3

    One quick, simple request. Could you add a total at the bottom of the size column? My host got a bit miffed at me for not tracking database size better. Your plugin is the best cleanup tool. If it gave me the total stat, it would be perfect.

    Any thought about having the cleanup kick off at regular intervals?

  77. asean tourism

    I guess the best feature this plugin offers is to remove revision of the posts from db which its really nice, as you describe… it can take lots amount of db space, may be those revision are useful for some people, but I don't need that :mrgreen:
    Is it working on WP 2.8.1 ?
    What if you add another feature such to remove duplicate posts from db ? just a lil hope and thank you, gotta try this plugin :)

  78. chiendent

    Hello,
    Great pluggin I will use it for a blog on a 2.7 version. However
    what do I risk if I try to use WP-optimize with a 2.1 version? I can try to adapt the pluggin?

  79. eavasi

    Thank you so much for this plugin Ruhani!!! I like it so that translate it in russian and put it to download on my blog 'White Hat' www(.)eavasi(.)ru
    THANKS ONES MORE!!!

  80. Ruhani Rabin

    the plugin doesn't touch any settings in the wp database .. it is like phpmyadmin in a very simpler interface.. so you can try optimizing the database using phpmyadmin .. the results should be the same.. in the mean time i look into it .. thanks for the feedback :)

  81. ckenton

    I tried your plugin on my wordpress/Thesis blog today. It worked for cleaning up the database, but caused some other problems that seem to mirror problems another commenter posted about. In my case, many of the blog's design settings disappeared–including each page's template assignment, and the column width/number settings. I had to deactivate the plugin, and go back and reset all the blog's design settings.

  82. nawed karim

    I would like to add that i have also installed a plugin to remove common words from slug called remove stop word from slug by alberto avera and if this plugin has removed the post or your plugin wp-optimize is not clear. so it needs some R&D

  83. nawed karim

    I dont know how it happened but after optimizing my database using your plugin around 30 of my post started ginving 404 error. i think if this plugin is not asking any table to optimize in red then the optimize button should not be clicked and i accidently pressed the optimize button to already optimized database and 30 of my post went missing.
    I found all those 30 article present in the post edit page of admin section and to restore the articles i used quick edit option and simply pressed update button and the article again came back sound and healthy. google indexed all those 30 article as missing and after troubleshooting i am hoping that google will not penalize my blog.

  84. Lillea

    Thank you for creating this! I just got rid of 5 MB. My blog is rather new but I tend to edit my posts a lot.

  85. Grump

    I have several blogs with from 400 posts to almost 8000 posts. My web host had to move me to my own server due to them causing so much lag. After running WP-Optimize on all my blogs, it saved just shy of 25mb!

  86. Syed M. Ruhani Rabin

    Thanks Rob for the excellent Idea.. I need to find some time to implement it :) Don't worry about the tabs, later i tab them again.. I might need to contact you directly about this, hope you wont mind :) again, thanks a LOT

  87. Rob

    Hello…
    Good plugin! However, part of deleting revisions should also be to get rid of all postmeta data associated with those revisions. Inserting the following code at line 74 of wp-optimize-admin.php will solve the problem:

    $allposts = get_posts(‘numberposts=-1&orderby=ID&order=ASC&post_type=any&post_status=’);
    $allpost_ids = array();
    foreach ($allposts as $onepost)
    $allpost_ids[$onepost->ID] = true;
    $cleaned_ids = array();
    $total_cleaned_metas = 0;
    $postmeta = $wpdb->get_results(“SELECT * FROM $wpdb->postmeta”, OBJECT);
    foreach ($postmeta as $meta)
    if (!isset($allpost_ids[$meta->post_id]) && !isset($cleaned_ids[$meta->post_id])) {
    $cleaned_metas = $wpdb->query(“DELETE FROM $wpdb->postmeta WHERE post_id = ‘”.$meta->post_id.”‘”);
    $total_cleaned_metas += $cleaned_metas;
    $cleaned_ids[$meta->post_id] = true;
    }
    $message .= $total_cleaned_metas.__(‘ postmeta items from revisions and nonexistant posts deleted’, $textdomain);

    i know, it looks a bit odd here, but the indentation will be in line with what’s in the file. ;) This includes a status message line (which could be omitted), and the admin prompt could possibly be rewritten a bit. Of course, this could as well also be another separate option / function of the plugin, as it gets rid of orphaned postmetadata in general, not only that which got left over by deleted revisions.

  88. Rob

    Hello…
    Good plugin! However, part of deleting revisions should also be to get rid of all postmeta data associated with those revisions. Inserting the following code at line 74 of wp-optimize-admin.php will solve the problem:

    $allposts = get_posts('numberposts=-1&orderby=ID&order=ASC&post_type=any&post_status=');
    $allpost_ids = array();
    foreach ($allposts as $onepost)
    $allpost_ids[$onepost->ID] = true;
    $cleaned_ids = array();
    $total_cleaned_metas = 0;
    $postmeta = $wpdb->get_results(“SELECT * FROM $wpdb->postmeta”, OBJECT);
    foreach ($postmeta as $meta)
    if (!isset($allpost_ids[$meta->post_id]) && !isset($cleaned_ids[$meta->post_id])) {
    $cleaned_metas = $wpdb->query(“DELETE FROM $wpdb->postmeta WHERE post_id = '”.$meta->post_id.”'”);
    $total_cleaned_metas += $cleaned_metas;
    $cleaned_ids[$meta->post_id] = true;
    }
    $message .= $total_cleaned_metas.__(' postmeta items from revisions and nonexistant posts deleted
    ', $textdomain);

    I know, it looks a bit odd here, but the indentation will be in line with what's in the file. ;) This includes a status message line (which could be omitted), and the admin prompt could possibly be rewritten to indicate that postmeta data will be included in the cleaning. Of course, this could also be a separate option / function of the plugin, as it gets rid of orphaned postmetadata in general, not only that which got left over by deleted revisions.

  89. mike

    What an excellent plugin! My freelance $$$ are very tight right now however, next project I get will definitely make a donation. Thanks much.

  90. Colin

    Wow, that was fast!

    I see that you closed the img tag, but that's not the cause of the https problem — that was one of two issues. The https access problem is because WP_PLUGIN_URL contains http rather than https, regardless of the access mode. Using bloginfo('url') will help with that, if the url is filtered elsewhere — that's how my fix works. An option, of course, is to insert some is_sll() php magic yourself, in your construction of the image url or in the WP_PLUGIN_whatever constants.

    Feel free to contact me via the mail address I'm posting with if I've managed to miscommunicate on this one.

    Colin

  91. Colin

    Ruhani,
    First, thanks for the great plug-in!

    I've found that The WP-Optimize admin module has a couple of bugs in it. Here's the original code, from line #217 of the wp-optimize-admin.php file:

    <td colspan=”2″><img src=”<?php _e(WP_PLUGIN_URL) ?>/wp-optimize/wp-optimize.gif” border=”0″ alt=”WP-Optimize Admin” title=”WP-Optimize Admin”</td>

    This has two problems:
    1. It results in mixed content warnings from IE when accessed via https; the image URL ends up with http in it.
    2. The img tag is not closed.

    Here's my fix:

    <td colspan=”2″><img src=”<?php bloginfo('url'); ?>/wp-content/plugins/wp-optimize/wp-optimize.gif” border=”0″ alt=”WP-Optimize Admin” title=”WP-Optimize Admin” /></td>

    I'm also using a “HTTPS for WordPress” plugin, so the bloginfo call returns the appropriate url, with either http or https as the protocol, as appropriate. There may be other solutions, and without the additional plugin this might not work — but it works for me, for now.

    You might want to look into that.

    Thanks!
    Colin

  92. Ruhani Rabin

    actually the plugin does everything how phpmyadmin works.. so if you've encountered mysql overhead .. you can try the same with phpMyadmin too.. it will give you same result… :) hope this helps.

  93. vesket

    Result from the next optimization (third today): Total Space Saved: 11269.391 Kb

    Changes since last optimization: Five small spams removed, none longer than 200 bytes

  94. Ketil Vestby

    This plugin is weird: I upgraded my backend-database today, from MySQL 4.2 to 5.1. Used the plugin to optimize the database before backing up. After restoring, the plugin found 13341.883 Kb of content to “optimize”.

  95. Prasand J.

    I like this plugin a lot. I always hated to see so many revisions. However, is it possible to add an option to only keep the original and latest version, but delete all other revisions?

  96. 0p0

    excelent plug!
    it made my site three times beter, I've been looking for something like this for a while
    thank you and keep up the good work! :D

  97. Ruhani Rabin

    @max, please don’t try to put everything to one direction and blame one thing. Most probably you’re database was already corrupted so the optimize command may do that..

    most probably your website does meet one of the following requirements

    1. your website running on less that a version of wordpress 2.7

    2. you are not running mysql 5.1.xx

    3. your database tables were corrupted

    and please post your comments in lowercase and sentence case.

    Also try to run in a local host or ubuntu box for testing.

  98. Ruhani Rabin

    @max, please don’t try to put everything to one direction and blame one thing. Most probably you’re database was already corrupted so the optimize command may do that..

    most probably your website does meet one of the following requirements

    1. your website running on less that a version of wordpress 2.7

    2. you are not running mysql 5.1.xx

    3. your database tables were corrupted

    and please post your comments in lowercase and sentence case.

    Also try to run in a local host or ubuntu box for testing.

  99. max

    i think it has a very big problem!!!!!!!!!!!!!!!

    it erases me all my content!!!!!!
    big big big problem!!!!
    2hours of work to restabilish all!!!!!!

    a disaster!!!!!!!!!

    very sad…

  100. Tom B.

    Just wanted to let you know, I have been using this on my blog with no problems (so far), with MySQL v4.0.27-max-log and PHP 4.4.9. I have optimized my tables, and about everything else except change my user name, and have had no error messages.

  101. Tom B.

    Just wanted to let you know, I have been using this on my blog with no problems (so far), with MySQL v4.0.27-max-log and PHP 4.4.9. I have optimized my tables, and about everything else except change my user name, and have had no error messages.

  102. Tim

    Currently I don’t have any tables in the list. Should I see a list of tables before I run any processes?

  103. Tim

    Currently I don’t have any tables in the list. Should I see a list of tables before I run any processes?

  104. Ruhani Rabin

    @Tim, glad it worked out.. tables report as you can see the 3rd column shows the optimization status, those table need to be optimized will be in red color stated ‘Need to optimize’ .. once you’ve run the optimize command those tables will be marked in Blue color stated ‘Optimized’

  105. Tim

    I’ve managed to change php to version 5.2.5 and it’s now OK. I assume that the tables report will not show anything until I actually run the optimizer?

    1. Ruhani Rabin

      @Tim, glad it worked out.. tables report as you can see the 3rd column shows the optimization status, those table need to be optimized will be in red color stated ‘Need to optimize’ .. once you’ve run the optimize command those tables will be marked in Blue color stated ‘Optimized’

  106. Tim

    I’ve managed to change php to version 5.2.5 and it’s now OK. I assume that the tables report will not show anything until I actually run the optimizer?

  107. Ruhani Rabin

    @Tim, what is your version of MySQL? This has been tested with mySql 5 and Php 5.

    @Gt, that option has been implemented, you can see how much total space can be saved.

  108. Ruhani Rabin

    @Tim, what is your version of MySQL? This has been tested with mySql 5 and Php 5.

    @Gt, that option has been implemented, you can see how much total space can be saved.

  109. Tim

    I have the latest version downloaded (twice now) and get this error message:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/timchurch.me.uk/public_html/blog/wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 316

    I’m using wordpress 2.7

  110. Tim

    I have the latest version downloaded (twice now) and get this error message:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/timchurch.me.uk/public_html/blog/wp-content/plugins/wp-optimize/wp-optimize-admin.php on line 316

    I’m using wordpress 2.7

  111. gt

    thanks for this plugin.

    I have a feature request:

    add a “total” row in the “tables report”, so we can easily see how many bytes will be saved by optimization and how much bytes take all wp related tables in the database.

    IMHO that would be very useful

    TIA and sorry for my english

  112. gt

    thanks for this plugin.

    I have a feature request:

    add a “total” row in the “tables report”, so we can easily see how many bytes will be saved by optimization and how much bytes take all wp related tables in the database.

    IMHO that would be very useful

    TIA and sorry for my english

  113. Ruhani Rabin

    @Michael Jäkel, The thought flew in my mind few times and I’ve did some R&D. It might make a impact on your mysql server, even can make some tables corrupted if you do too much optimization command on a mysql database. That is why I put it in selective mode. But I will try to find out a way to implement it in near future.

  114. Ruhani Rabin

    @Michael Jäkel, The thought flew in my mind few times and I’ve did some R&D.; It might make a impact on your mysql server, even can make some tables corrupted if you do too much optimization command on a mysql database. That is why I put it in selective mode. But I will try to find out a way to implement it in near future.

  115. Michael Jäkel

    Great Plugin works fine.
    Is that a way that i start it automaticaly every Hour to auto optimize the Database Tables ?
    I use only the “Optimize database tables” function.

    Best regards DD6VD

  116. Michael Jäkel

    Great Plugin works fine.
    Is that a way that i start it automaticaly every Hour to auto optimize the Database Tables ?
    I use only the “Optimize database tables” function.

    Best regards DD6VD

  117. lord

    Something i’ve been looking for a long tim. works perfectly with 2.7. Thanks for this awesome plugin

  118. Ruhani Rabin

    @Angelo : I think it’s better to wait until i release a stable version of the plugin. Because it’s not mature yet and i need to re-organize the codes too..

  119. Angelo Gon

    @Ruhani

    Installed in other 3 of my blogs and no errors and working very fast.

    PS.:

    Maybe I can Translate to my language (Portuguese) one of my sites is about wordpress plugins and Im trying to translate all good plugins to portuguese (Brasil)

    Just drop me a line and I can translate the plugin

    regards

    1. Ruhani Rabin

      @Angelo : I think it’s better to wait until i release a stable version of the plugin. Because it’s not mature yet and i need to re-organize the codes too..

  120. Angelo Gon

    @Ruhani

    Installed in other 3 of my blogs and no errors and working very fast.

    PS.:

    Maybe I can Translate to my language (Portuguese) one of my sites is about wordpress plugins and Im trying to translate all good plugins to portuguese (Brasil)

    Just drop me a line and I can translate the plugin

    regards

  121. Ruhani Rabin

    @FridayKhutbah: Please re-download the plugin again and try. I guess there were 2 subfolders inside the plugin zip file.

    @Angelo: Thanks for the tryout. I’m planning to add some tweaking features too.

  122. Ruhani Rabin

    @FridayKhutbah: Please re-download the plugin again and try. I guess there were 2 subfolders inside the plugin zip file.

    @Angelo: Thanks for the tryout. I’m planning to add some tweaking features too.

  123. Friday Khutbah

    After Installing, I am getting error:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in {path-to}pluginswp-optimizewp-optimizewp-optimize-admin.php on line 251

    I’ll check the code when I get home.

    Regards

  124. Friday Khutbah

    After Installing, I am getting error:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in {path-to}pluginswp-optimizewp-optimizewp-optimize-admin.php on line 251

    I’ll check the code when I get home.

    Regards

Comments are closed.