上代碼
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 結(jié)束ID;
update `wp_posts` set `post_date_gmt` = `post_date` WHERE `ID` between 起始ID AND 結(jié)束ID;
update `wp_posts` set `post_modified_gmt` = `post_modified` WHERE `ID` between 起始ID AND 結(jié)束ID;
update `wp_posts` set `post_status` = 'publish' WHERE `ID` between 起始ID AND 結(jié)束ID;
PS:有時為了吸引蜘蛛爬行,經(jīng)常會重新修改一下最后更改時間,蜘蛛以為文章已經(jīng)更新了料祠,就會來爬骆捧,但這種方法不適宜多次使用,有欺騙蜘蛛的風險术陶,各位自行承擔凑懂。