We had a client come to us and ask how to re-enable comments on older posts. I started searching around and found 2 ways of allowing comments on many posts at once.
1. Use the built-in WordPress Bulk Edit feature.
This feature was introduced back in version 2.7 but only now did I fall in love with it! It allows you to batch edit lots of information for multiple posts at one time: change categories, modify the author, change the post status, and most importantly (for me, right now), open or close comments.
To use it, go to:
- Posts > All Posts
- Select the posts you want to edit by checking off the checkboxes next to the post title.
- Click on the Bulk Actions dropdown menu.
- Select Edit and click Apply. It’s a bit scary to have to click on Apply before you’ve made changes but once you build up the courage, it’s worth it! No changes will happen yet.
- In the Comments dropdown, select Allow.
- If you want to edit more than the default 20 posts per page in the admin screen, you can go to Screen Options in the top right corner and change the number of Posts Displayed per page.
- Done! However, I had to check a few posts to make sure that it actually worked. I think that there is something buggy in the feature because it only worked some of the time. Maybe there is a max of how many posts can be bulk edited at once.
This method is good if you don’t want to get into the database. My only complaint is that it’s a bit time consuming and there’s no way of seeing a list of all the posts that have comments open or closed.
2. Do some SQL work in the Database
The other option for allowing comments globally in WordPress is to get into the PHPMyAdmin (ugh) and run a script to open all comments. Although it can be scary to get into the database and run SQL queries, it is the most accurate way of making sure the comments are open on all your posts.
Here’s the SQL query to run to open all comments:
UPDATE wp_posts SET comment_status = 'open';
As you can see, each method has its pros and cons. Making this change within the dashboard is not as daunting but you don’t feel like you have as much control over the process. Also, it seems not to work 100% of the time, for some reason. And going into the database is, well, daunting. But otherwise, at least you know that it does what it’s supposed to do. It’s very possible that the dashboard direction is one we’d explain to a client but that if this is something we’re working on, we’ll prefer to go the database route.