Skip to content

Instantly share code, notes, and snippets.

@s9011514
Last active June 22, 2016 16:54
Show Gist options
  • Save s9011514/344d438cae0e7bd15d4221693cc73bf7 to your computer and use it in GitHub Desktop.
Save s9011514/344d438cae0e7bd15d4221693cc73bf7 to your computer and use it in GitHub Desktop.
WordPress 批次開啟/關閉留言功能,教學說明: https://sofree.cc/wordpress-bulk-comment-close/
/*批次關閉所有文章留言*/
UPDATE wp_posts SET comment_status = 'close' WHERE post_type = 'post' ;
/*針對全部草稿文章關閉留言*/
UPDATE wp_posts SET comment_status = 'close' WHERE post_status = 'draft' AND post_type = 'post' ;
/*批次開啟所有文章留言*/
UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'post' ;
/*批次開啟所有頁面留言*/
UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'page' ;
/*批次關閉所有頁面留言*/
UPDATE wp_posts SET comment_status = 'close' WHERE post_type = 'page' ;
/*批次關閉所有文章Trackback通知引用*/
UPDATE wp_posts SET ping_status = 'closed' WHERE post_type = 'post' ;
/*批次開啟所有文章Trackback通知引用*/
UPDATE wp_posts SET ping_status = 'open' WHERE post_type = 'post' ;
/*針對全部已發表文章開啟留言*/
UPDATE wp_posts SET comment_status = 'open' WHERE post_status = 'publish' AND post_type = 'post' ;
/*針對全部已發表文章關閉留言*/
UPDATE wp_posts SET comment_status = 'close' WHERE post_status = 'publish' AND post_type = 'post' ;
/*針對全部草稿文章開啟留言*/
UPDATE wp_posts SET comment_status = 'open' WHERE post_status = 'draft' AND post_type = 'post' ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment