使用SQL命令批量更改wordpress文章发布时间

只有3个设置:

1、起始时间自己更改一下。’2014-1-01′

2、然后就是控制随机生成在那个日期段。500

3、文章的起始ID和结束ID。6297 AND 14332

UPDATE `wp_posts` SET `post_date` = DATE_ADD(‘2014-1-01’, INTERVAL ROUND(RAND() * 500 + 1) DAY) WHERE `ID` between 6297 AND 14332;

update `wp_posts` set `post_modified` = `post_date` WHERE `ID` between 6297 AND 14332;

update `wp_posts` set `post_date_gmt` = `post_date` WHERE `ID` between 6297 AND 14332;

update `wp_posts` set `post_modified_gmt` = `post_modified` WHERE `ID` between 6297 AND 14332;

update `wp_posts` set `post_status` = ‘publish’ WHERE `ID` between 6297 AND 14332;

然后再数据库里执行就可以了。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注