timestamps on drafts in wordpress

I don’t know if anyone else has run into this problem, but I had a bunch of old drafts when I upgraded to WordPress 2.0.2. When I published one, the timestamp wasn’t updated to the current time and it was annoying to have to change it manually. I found out that a fix had been introduced in 2.0 that sets the post_date to all 0s when a draft is created. This is what caused the problem because all my drafts already had dates, so they were treated as if they had already been published. To fix the problem I ran the following command in MySQL to set the post date of all my drafts to 0s.

UPDATE wp_posts SET post_date = ‘0000-00-00 00:00:00’ WHERE post_status = ‘draft’;

In short, if you created drafts before upgrading to 2.0 and you’re experience weird things with your timestamps when you publish, run this command in MySQL directly or using a tool like phpMyAdmin.


 (Post a comment) | Comments RSS feed
  1. Dan
    Is there any down side to changing the post date after the event?

    In my case, I’m importing a LOT (3,000+) of posts via Import-RSS; I am probably making a mistake in the RSS date field, but in any event the post date is appearing as the import date and not the original date(as nominated by me). Since my posts date back over 100 years (it’s a long story), there are major implications in having a post-date that doesn’t reflect the “true” date of the post. I’m content to modify the date via MySQL, but I’m worried that it might fix one problem only to create another .

    This is a major problem for me; happy for you to reply direct.


    Comment by Tedinoz on August 1, 2006 @ 4:56 am

Comments are closed