大家做WordPress采集的时候,可能没有设置好填充文章时间,不要紧,可以通过后处理来修改这个时间。

在sql中执行以下语句:

UPDATE `wp_posts` SET `post_date` = DATE_ADD('2018-1-10', INTERVAL ROUND(RAND() * 220 + 1) DAY)  WHERE `ID` between 1 AND 1215;
update `wp_posts` set `post_modified` = `post_date` WHERE `ID` between 1 AND 1215;
update `wp_posts` set `post_date_gmt` = `post_date` WHERE `ID` between 1 AND 1215;
update `wp_posts` set `post_modified_gmt` = `post_modified` WHERE `ID` between 1 AND 1215;
update `wp_posts` set `post_status` = 'publish' WHERE `ID` between 1 AND 1215;

表示从时间2018-1-10开始,220天内,文章ID从1到1215范围内的文章,批量随机修改其发布时间。