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.







Number of readers
- home
comics
news links
other links

about me
blog archives
docs
entertainment
experiences
funny lists
humor
intellectual
interests
metafilter
music
opinions
photos
web designs
tools
software
webmaster help

Sign up
Enter your email address to be notified of new blog posts



Search blog archives

Calendar
May 2006
S M T W T F S
« Apr   Jun »
 123456
78910111213
14151617181920
21222324252627
28293031  







Random quote
(View all quotes)
"Absence makes the heart grow fonder -- of somebody else."










(?) Choose theme:  X X X X X X