Posted on Jan 10, 2013 in WordPress | 2 comments
Have you ever wanted to turn on comments for all your pages at once? Or perhaps managing comments is too much of a pain, so you decide you want to disable comments for all of your WordPress blog posts easily.
The most obvious way is, when editing a page or post, to scroll down to the “Discussion” section and check or uncheck the “Allow comments” box.
Don’t see the “discussion” section on the page/post edit screen? At the top of the screen on the right side there is a “Screen Options” button. Click it and check the box for “Discussion” to make those settings visible.
When on the Pages admin screen or the Posts admin screen listing your articles, check the boxes to select which ones you want to change (or click the checkbox at the top of the table next to “Title”), then select “Edit” from the “Bulk Actions” drop down menu and click “Apply.” You will have a “Comments” drop down, among others, where you can select to allow or disallow comments and then click the blue “update” button in the lower right.
This is very handy for efficiently changing that on a set of specific posts, but if you want to change all of your posts or pages, changing them 20 at a time can get frustrating.
It’s easier than you think to make this global change, but it does require that you are able to edit your database directly.
Enable comments on all Pages
UPDATE wp_posts SET comment_status = 'open' where post_type ='page';
Disable comments on all Pages
UPDATE wp_posts SET comment_status = 'closed' where post_type ='page';
Enable comments on all Posts
UPDATE wp_posts SET comment_status = 'open' where post_type ='post';
Disable comments on all Posts
UPDATE wp_posts SET comment_status = 'closed' where post_type ='post';
Thank you for explanatory narration.
THX, saved me a lot of time and did the job well on my WordPress 4.5.3 Blog!