Created
December 29, 2011 23:17
-
-
Save kovshenin/1536654 to your computer and use it in GitHub Desktop.
Change the year of all posts in a particular category to 2012
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_posts AS p | |
JOIN wp_term_relationships AS tr ON tr.object_id = p.id | |
JOIN wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id | |
JOIN wp_terms AS t ON tt.term_id = t.term_id | |
SET p.post_date = REPLACE(p.post_date, YEAR(p.post_date), 2012) | |
WHERE t.slug = 'my-category-slug' AND tt.taxonomy = 'category'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment