1

Is it possible to use the user-interface (front-end) part of Wordpress to open comments on all posts in one (or two) clicks? I have many posts with closed comments which must have happened by mistake, and I want to make them all open comments.

Here's the caveat: My host provider doesn't give me ssh access into the database, so I can't just run a simple sql REPLACE command. Therefore, I need a way to do this from the Administration Panel within wordpress.

Thanks!

6

I wrote up this quick plugin that updates all posts of type post to comment_status open on activation, it should work for you. you can immediately deactivate and delete it once you activate it that once.

<?php
/*
Plugin Name: update comment status
*/
function activate_update_comment_status() {
    global $wpdb;
    $wpdb->update( 
        $wpdb->posts, 
        array( 
            'comment_status' => 'open'
        ), 
        array(
            'post_type' => 'post'
        ), 
        array( 
            '%s'
        ), 
        array(
            '%s'
        ) 
    );
}
register_activation_hook( __FILE__, 'activate_update_comment_status' );
  • This works perfectly on v5.2.2 in 2019. Thanks, man! – Alex Aug 10 at 23:14
0

Just because this method is so out dated, here's a modern solution.

In the wp-admin under Posts when you see the list of all your posts, check the box next to Title so that all your posts are selected. Then choose the bulk option Edit. From here you can change all your comments to Allow in the select box. Then click update. This now allowed comments on all your posts at once.

  • How would I do that if I have 6000 posts? The plugin method above works perfectly. – Alex Aug 10 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.