Skip to content

Instantly share code, notes, and snippets.

@jasperf
Created November 5, 2012 02:39
Show Gist options
  • Save jasperf/4014996 to your computer and use it in GitHub Desktop.
Save jasperf/4014996 to your computer and use it in GitHub Desktop.
Change all Post Dates in WordPress #wordpress #posts
//DATE_ADD to add and DATE_SUB to substract. Do not forget to backup DAY and YEAR can be used as well
//Adjust table prefix when needed
//Also see http://wordpress.org/support/topic/possible-to-change-publishing-dates-of-all-posts-in-one-shot?replies=3
UPDATE wp_posts
SET post_date = DATE_ADD( post_date, INTERVAL 12 MONTH ),
post_date_gmt = DATE_ADD( post_date_gmt, INTERVAL 12 MONTH ),
post_modified = DATE_ADD( post_modified, INTERVAL 12 MONTH ),
post_modified_gmt = DATE_ADD( post_modified_gmt, INTERVAL 12 MONTH )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment