Mine the Harvest

WordPress 2.5 & Database Changes

by on Apr.06, 2008, under IT Adventures

Last week I upgraded the blog software (which drives this wonder of technology blog site) to the latest WordPress 2.5. The upgrade went very well, though there was one database change that caused an issue with comments not showing up correctly in the management interface. It would say there were comments waiting but not display them when you clicked the link. This was due to a new field being added to the wp_comments database which needs to be indexed.

The WordPress forums do have a mention of this, but it is a bit buried and the fix may elude some users. After Googling a bit it was easy to see the issue was due to a database schema change in the wp_comments table.

The solution is simple, and you can do it in the mysql client (for you shell happy guys) or using phpmyadmin.

Shell Method:

In the mysql client just execute:

use your_wordpress_database_name;

create index comment_date_gmt on wp_comments(comment_date_gmt);

This comes from here and I just added some clarification for newer users. Just type mysql in the shell to start the client, if you don’t know the database name just execute: show databases;

PhpMyAdmin:

Select your WordPress database and then the wp_comments table. Select the comment_date_gmt field (just put a check mark in the box for that field). Then, at the far right click on the index icon – it has lightening bolt on it. This creates the index on the field. Yep, that’s it.

After either of the above you should be able to refresh your comments page and you should now see all the comments, including the ones needing approval, etc.

No comments for this entry yet...

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...