WordPress批量修改发布时间一段时间范围内或按文章ID修改

SQL:

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 1 AND 1000;
update `wp_posts` set `post_date_gmt` = `post_date` WHERE `ID` between 1 AND 1000;
update `wp_posts` set `post_modified_gmt` = `post_modified` WHERE `ID` between 1 AND 1000;
update `wp_posts` set `post_status` = 'publish' WHERE `ID` between 1 AND 1000;

SQL详解

UPDATE `wp_posts` SET `post_date` = DATE_ADD('起始时间', INTERVAL ROUND(RAND() * 随即日期范围单位:天 + 1) DAY)  WHERE `ID` between 6297 AND 14332;
update `wp_posts` set `post_modified` = `post_date` WHERE `ID` between 起始ID AND 结束ID;
update `wp_posts` set `post_date_gmt` = `post_date` WHERE `ID` between 起始ID AND 结束ID;
update `wp_posts` set `post_modified_gmt` = `post_modified` WHERE `ID` between 起始ID AND 结束ID;
update `wp_posts` set `post_status` = 'publish' WHERE `ID` between 起始ID AND 结束ID;

 

思源源码基地https://www.rmb4.cn所有源码资源均聚合于互联网各大会员资源站,仅用于您下载学习,如需商用,请您支持正版! 转载请注明出处!
源码基地-站长之家-网站模板-网站源码-源码之家-html模板-网页模板-Wordpress主题-织梦模板 » WordPress批量修改发布时间一段时间范围内或按文章ID修改

源码基地,源码之家,全网网站源码,APP源码,免费下载,采集规则免费教学!

立即赞助 发布资源