WordPress.org

Support

Support » How-To and Troubleshooting » How do we remove comments

How do we remove comments

  • Is there a safe and elegant way to remove all trackback and comments links and references – when I try to remove specific lines it causes parsing errors.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You can swith off comments and trackbacks under Options >> Discussion. This only affects new posts, though.

    Which version of wp ?

    1.5 beta – I want to remove even the references like “no comments” at or “comments closed” from the bottom of pages.

    Moderator James Huff

    @macmanx

    To stop comments and trackbacks, delete the wp-comments-post.php and wp-trackback.php files. To delete the references to them on the main pages, look for the values like “no comments” or “comments closed” in index.php and delete them.

    To stop comments and trackbacks, delete the wp-comments-post.php and wp-trackback.php files. To delete the references to them on the main pages, look for the values like “no comments” or “comments closed” in index.php and delete them.

    Is this still considered the best approach for 1.5 final?

    I’m not at 1.5 yet, but I found that if I set “use_trackback” and “use_pingback” values in the “options” table to “0”, those options disappear in the “writing” pane.

    After hours of searching, and help from my buddy, we discovered that there’s a line of code in the index.php file located in the dir of the theme you are currently using.

    I’m assuming you mean the part where it says “Posted in (category) | Edit | Comments disabled”

    (Assuming you are working with the default theme:)

    Delete wp-comments-post.php and wp-trackback.php in your root directory, and then delete comments.php and comments-popup.php in your theme directory.

    Then, in the index.php in your theme directory delete:

    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

    In the single.php of your theme directory, delete:

    <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Both Comments and Pings are open ?>
    You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(display); ?>">trackback</a> from your own site.

    <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    // Only Pings are Open ?>
    Responses are currently closed, but you can <a href="<?php trackback_url(display); ?> ">trackback</a> from your own site.

    <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    // Comments are open, Pings are not ?>
    You can skip to the end and leave a response. Pinging is currently not allowed.

    <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    // Neither Comments, nor Pings are open ?>
    Both comments and pings are currently closed.

    Also delete:
    <?php comments_template(); ?>

    That should be it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How do we remove comments’ is closed to new replies.
Skip to toolbar