I have 7000+ posts published on October 31, 2021. What SQL should I use to change the date for all those posts to Feb 1, 2022?
I run a WordPress site with MySQL 5.7.37 and PHP 7.4.
Honestly, I have no idea of anything.
Any help to change the date in bulk for thousands of posts at once will be much appreciated.
Looking forward to some help from experts!
2
Answers
Exactly as already mentioned in comments.
Double-check the post_date format first though, as it may be in long number format etc.
If you’re going to update post date from your theme / plugin’s code then you can use
$wpdb
to run the SQL command. Something like this:Note:
$wpdb->posts
returns the name of your post table dynamically so you don’t have to remember the post table name.If you’re going to use the command directly from
phpmyadmin
then just use