Database maintenance for wordpress to run optimized

With phpmyadmin it is actually pretty simple:

FIRST: make a backup of your database.

The go into phpmyadmin, select your wordpress database, and click the sql tab, and enter the following query:

SELECT *FROM wp_comments WHERE comment_approved =”0″

that should select all 282125 records. If you get that number, then do the following query:

delete from wp_comments WHERE comment_approved =”0″

That should delete all pending comments.

You may want to run a repair on your db files after that big delete, just in case. You can do this by using phpmyadmin, select the table with overhead bytes then repair it.

 

Useful plugins:

  • Facebook Comments by Anderson Makiyama
  • Sociable by Blogplay
  • AZindex by English Mike
  • Google XML sitemaps by Arne B.
  • Quickadsense Philip Ze
  • RSS Importer by wordpress
  • Search & Replace Frank B.
  • Simple Tags by Amaury Balmer
  • Subscribe2 by Matthew Robinson
  • Tubepress by Eric H.

To close all comments for all articles in sql use statement :  UPDATE *wp_posts SET comment_status=”closed”