上代碼
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('起始時(shí)間', 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:有時(shí)為了吸引蜘蛛爬行,經(jīng)常會(huì)重新修改一下最后更改時(shí)間黍翎,蜘蛛以為文章已經(jīng)更新了凉驻,就會(huì)來爬檐蚜,但這種方法不適宜多次使用,有欺騙蜘蛛的風(fēng)險(xiǎn)沿侈,各位自行承擔(dān)。
作者:詩無盡頭i
鏈接:http://www.reibang.com/p/973e6f979dd9
來源:簡書
著作權(quán)歸作者所有市栗。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán)缀拭,非商業(yè)轉(zhuǎn)載請(qǐng)注明出處。