WordPress.org

Ready to get started?Download WordPress

Forums

how to disable comments (14 posts)

  1. lewistang
    Member
    Posted 4 years ago #

    hi everybody, i am using wordpress building a business website, and i do not need the comments appear my pages, even the words "Comments Off".

    what should i do to disable comments? thanks

  2. Anna
    Member
    Posted 4 years ago #

    Go into your admin dashboard then click on "Themes" then "Editor".

    Click the "Page Template" from the right side and remove the following line:
    <?php comments_template(); ?>

  3. lewistang
    Member
    Posted 4 years ago #

    thanks man, but i did what you told me, but the "comments off" still there. what should i do?

  4. dsteinschneider
    Member
    Posted 4 years ago #

    Hi lewistang,

    I'm no WordPress expert but here is how I fixed it:

    In Main Index Template section:

    <div class="postBottom">
    				<small>
    					<a href="<?php the_permalink() ?>" title="" class="comments" style="float: left;"><?php comments_number('', '1 Comment', '% Comments' );?></a>
    					<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="more" style="float: right;">Read More...</a>
    				</small>
    			</div>

    I removed:

    <a href="<?php the_permalink() ?>" title="" class="comments" style="float: left;"><?php comments_number('', '1 Comment', '% Comments' );?></a>

    This got rid of the "0 Comments"

  5. dsteinschneider
    Member
    Posted 4 years ago #

    I did the same for a slideshow featured section - template "featured.php"

  6. lewistang
    Member
    Posted 4 years ago #

    thanks for your helps. i couldn't find the codes from upstairs in index.php, but i did delete the codes below :

    "?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?"

    and the "comment off" is gone in the index.php, still on other pages, how to get rid of it in all pages? by the way, my wordpress version is 2.9.2

  7. lewistang
    Member
    Posted 4 years ago #

    does anyone know?

  8. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    you remove the same code from page.php.

    You may need to do the same in multiple templates. Like single.php, possibly more, like archive.php, etc.

  9. lewistang
    Member
    Posted 4 years ago #

    thanks Rvoodoo, i've checked, the exact same codes
    <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?>
    only appears in index.php? what about other php files, how could i do it?

  10. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    something is calling comments...do you see anything comment related in those other templates?
    <?php comments_template(); ?>
    for instance?

  11. lewistang
    Member
    Posted 4 years ago #

    the exact same code appears in single.php, i've remove it as you told. what about others?

  12. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Not sure I quite understand what you are asking?

    What about others? Other templates? Other code?

  13. lewistang
    Member
    Posted 4 years ago #

    the rest of php files in the same theme

  14. lewistang
    Member
    Posted 4 years ago #

    "comments off" still appears.

Topic Closed

This topic has been closed to new replies.

About this Topic