Support » Fixing WordPress » How to make default no comments

  • Resolved amyrogers


    When a new post is saved I have to turn off the Allow Comments each time. Is there a way to set this as default?

    Also, since there will be no comments for each posting, how do I remove the the comment section from the page, without deleting the theme file that contains the code for comments? I may want to use them later.

    Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • well you could open up index.php in a text editor, and comment out the part of the WordPress loop that links to comments.

    If you ever decide to want comments, you can just lift the comment-code opening and close, or you could link to the comments in the post yourself.

    There is an option somewhere in Discussion, I think, that switches off comments. Have a look around anyway.

    As for “commenting stuff out”:

    Go through all the template files and find the bit that says “get_comments” or something like that (not sure of the actual name).

    Then put /* */ around the “get comments” so:

    <?php get_comments(); ?>


    <?php /* get_comments(); */ ?>

    That way it’s not processed, but you can still easily restore it.

    That did the trick! Thanks so much.

    I also do not want comments allowed.

    First, can someone tell me where I can find ‘the loop’ referred to previously, in the index page, and exactly what I am to delete.

    As well as (and I hope I don’t sound stoopid) but where I find the template files to get the “commenting stuff out.”

    Thanks and HUGz! Jules

    Info on what The Loop looks like:

    To extract the comments from all posts, locate and comment out:

    <?php comments_template(); ?>

    Note this may not be in a theme’s index.php, but rather single.php (for individual posts), as well as page.php (Pages).

    I just realized I still need to know how to make No comments as default in the Posting Area. The default is Comments Allowed which is checked already with each new post. How do I make it unchecked persistent?


    Options > Discussion, uncheck “Allow people to post comments on the article.”

    Yes, but for each new post, the checkbox is already checked. To clarify, to make that box unchecked in the first place for each post, without having to manually uncheck it?


    Again: Options > Discussion, uncheck “Allow people to post comments on the article.”

    This will (or at least, should) affect all new posts.

    If you know how to run queries on your database from phpMyAdmin, you can use this to switch off all comments and pings:

    Update wp_posts set ping_status = "closed"
    Update wp_posts set comment_status = "closed"

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to make default no comments’ is closed to new replies.