WordPress Task: Edit Post Dates in Bulk
Manual SQL changes
The simplest was is doing it in SQL:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# There are two values for every date (gmt and non-gmt) and their
# diff is varying because Daylight Saving Time clock change can
# be different at different date in different countries
#
SELECT post_date, post_date_gmt, post_modified, post_modified_gmt, post_name
FROM etkwp_posts
WHERE post_type = "shop" AND post_status = "publish"
ORDER BY post_date
LIMIT 10
# Now, just list older posts
#
SELECT DATE(post_date_gmt) as created, DATE(post_modified_gmt) as modified, post_name, post_title, post_status
FROM etkwp_posts
WHERE post_type = "shop"
AND post_status = "publish"
AND post_date <= DATE_SUB(CURDATE(), Interval 6 month)
ORDER BY post_date_gmt
LIMIT 10
# Change date 1 year forward step, only if is still older
# than modified date minus 5 days. Execute multiple times if you want.
#
UPDATE etkwp_posts
SET
post_date = DATE_ADD(post_date, Interval 1 year),
post_date_gmt = DATE_ADD(post_date_gmt, Interval 1 year)
WHERE post_type = "shop"
AND post_status = "publish"
AND DATE_ADD(post_date_gmt, Interval 1 year) <= DATE_SUB(post_modified_gmt, Interval 5 day)
|
We must should update both fields gmt and non-gmt date, as noted
here
Editing as WP admin
Add this option to programmatic to Wordpress.
Bulk edit post date in wordpress - WordPress Development Stack Exchange
or more advanced example:
bamadesigner/manage-wordpress-posts-using-bulk-edit-and-quick-edit: I wrote a tutorial for how to “Manage WordPress Posts Using Bulk Edit and Quick Edit” and decided it was best to convert my tutorial to plugin format and post online so I can better manage and keep up to date. You can view the tutorial at http://wpdreamer.com/2012/03/manage-wordpress-posts-using-bulk-edit-and-quick-edit
Manage WordPress Posts Using Bulk Edit and Quick Edit | WordPress Dreamer
How To Make Your WordPress Admin Columns Sortable | WordPress Dreamer
Plugin
As always, we could use a plugin:
oik-batchmove is the
only free one that can do this.
Custom Bulk/Quick Edit
doesn’t have edit date capability in free version.