WordPress.org

Forums

[resolved] How to make default no comments (11 posts)

  1. amyrogers
    Member
    Posted 9 years ago #

    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!
    Amy

  2. jackosh
    Member
    Posted 9 years ago #

    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.

  3. maerk
    Member
    Posted 9 years ago #

    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(); ?>

    becomes:

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

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

  4. amyrogers
    Member
    Posted 9 years ago #

    That did the trick! Thanks so much.

  5. Nekkid_Fish
    Member
    Posted 9 years ago #

    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

  6. Kafkaesqui

    Posted 9 years ago #

    Info on what The Loop looks like:

    http://codex.wordpress.org/The_Loop

    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).

  7. amyrogers
    Member
    Posted 9 years ago #

    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?

    Amy

  8. Kafkaesqui

    Posted 9 years ago #

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

  9. amyrogers
    Member
    Posted 9 years ago #

    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?

    A.

  10. Kafkaesqui

    Posted 9 years ago #

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

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

  11. maerk
    Member
    Posted 9 years ago #

    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"

Topic Closed

This topic has been closed to new replies.

About this Topic