Support » Fixing WordPress » Removing any reference to comments on select posts

  • Hi, Guys!
    I’m still very new to WordPress, but am learning a lot about coding by hand (previously I used dreamweaver and flash). What I would like to be able to do, is to remove any reference to comments on select posts. Basically, when I check the “No Comments” box when writing a post, I don’t want any reference to comments underneath that post. I don’t want it to say “Comments are currently closed” or make any reference to comments at all. I just want a clean post with the permalink, date, time, and posted by, but no comments.
    Is there a way to do this? Remember, I’m not a programmer (yet!), and I know almost nothing about php.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Mark (podz)


    Support Maven

    Line 58
    Change the text there ?

    I think this is what I’m looking for too but per the previous post, I’m not sure. So…if you remove that line of code, or change the text…change it to what? Then the word “comments” will not even show up in your posts? I ask that because I don’t even want it to. hehe. I’ll give it a go anyway and hope I don’t break sumthin. If I figure its a different way to do this, I’ll post here also.

    Ah! If you don’t even WANT a comments function, go to your index.php template and delete the following:
    <div class=”feedback”>
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); ?>
    That worked beautifully, and when I clicked on each of my categories it didn’t show there either, fyi. Coolness.

    But deleting this comments function, will delete all comments on ALL posts. What if I only want to remove the comments links on say three posts out of my 200 posts? Is there a way to do this?

    And I’m talking about posts, not pages. It appears that I cannot have custom template posts like custom template pages.

    I am using the plugin called “rc-custom-comment-text” to customize the comments such as “No comments”. But is there a plugin that will eliminate the comment for certain posts but not all?

    …or, you *could* just uncheck the box next to the post you’re writing (underneath “discussions”) that says “Allow Comments”. That’ll close the post to any comments. Then, to remove the “Comments are closed” message, go to your theme editor, and in your templates, look for the message that says “Comments closed for this post” and delete that message. Then *nothing* will appear when comments are closed.

    I tried that, but I still get “Comments Off” on the original page.

    When I click on Comments off, then it goes

    which shows “nothing”. But I want nothing on the first link.

    Ahh…well, you can do it by hacking a core file…

    open up wp-includes/comment-functions.php in Notepad. Find (witht he “find” function) “Comments Off”…you’ll come to a line that says this:

    function comments_popup_link($zero=’No Comments’, $one=’1 Comment’, $more=’% Comments’, $CSSclass=”, $none=’Comments Off‘) {

    Remove that “comments off” part, and leave it blank. Save and upload.

    This works on this page.

    But on the original page,

    I have “Comments (0)” still. Can I eliminate that? I think I would have to add something to the comments.php in the theme directory.

    For that matter, can I eliminate the [link] too on both pages?

    Actually, it’s still there on that first page you listed – it’s just not linked (and it’s now under your post instead of to the right).

    I don’t know – usually I’d just play around until I had it figured out. There *has* to be something somewhere that is calling for it to appear – I just run through files until i find it!

    Sorry I’m not much more of a help!


    I had re-inserted the “Comments are closed” in my template, what you had asked me previously.

    So on the first page I listed.
    that “Comments are closed” is easy to eliminate, as you stated before. Sorry to change things on you!

    It is on this page
    where the link for Comments (0) that I would like to eliminate.

    I think I have to put in a conditional “if” clause in the template comment.php that would address the “comments off” in the wp-includes/function-comments.php.

    But I’m not sure how to write that conditional “if” clause, if that is what I need.

    Since this is a post where I want to eliminate Comments (0) and not a page, I just have live with the Comments (0). Then I have to ensure that the “No Comment” box is ticked in the writing or editing of the post.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Removing any reference to comments on select posts’ is closed to new replies.