Bulk date change for wordpress posts

category: Snippets

There was a time when a client contacted me and asked me if it possible to change the dates of his posts. Before half a year i created for him a registry for product specifications, using (what else) wordpress. So after about six months he ended up with about 200 posts/products. So it was a nightmare to break my working schedule and start changing his posts one by one. Thankfully his employees were adding these posts in specific dates so it was easy for me to use the following SQL code in phpMyAdmin.

The first date under post_date is the current and the other is the new date.

UPDATE wp_posts SET post_date = REPLACE (
post_date,
'2008-01-30',
'2009-01-30')

Leave a Reply