• Hello,
    I was wondering how i would remove all comments on every post and page.
    I am trying to make my site more static.
    I have done some reading on the forums and as far as i can understand i have to edit something in my index.php file.
    I am no expert with this and would appreciate any help.
    ps: do you want me to paste the index.php code in here.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Edit your theme’s index.php file and remove all references to comments_popup_link(). You may have to repeat the process with category.php, archive.php and tag.php. In single.php, remove references to comments_template().

    Thread Starter westcountryleisure

    (@westcountryleisure)

    Hello,
    I started in the index.php and removed the words you mentioned…
    i got a Parse error: syntax error, unexpected

    Sounds like you deleted either too much or too little. Look for <?php comments_popup_link(... some text will be in here ...); ?> and delete from <?php to ?>.

    Thread Starter westcountryleisure

    (@westcountryleisure)

    i tried what you suggested and even removed the whole line, but still got the error
    As you will notice i ahve already edited out the author and timestamp, which worked fine.

    <?php get_header(); ?>

    <div id=”Main”>
    <div class=”Container”>

    <div id=”Sidebar1″>
    <?php include (TEMPLATEPATH . ‘/sidebar1.php’); ?>
    </div>

    <div id=”PostSet”>

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class=”Post” id=”post-<?php the_ID(); ?>”>

    </div>

    <div class=”postheader”>
    <h1>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h1>
    <div class=”postdetails”>

    </div>

    <div class=”postmeta”>

    </div>

    </div>

    <div class=”postcontent”>
    <?php the_content(‘Read More’); ?>
    </div>
    <div class=”postcomments”>
    <table>
    <tr>

    </td>
    <td>
    <?php comments_popup_link(”, ”, ”); ?>
    </td>
    </tr>
    </table>

    </div>

    <div class=”clear”></div>

    </div>

    <div>
    <div><?php next_posts_link(‘« Previous Entries’) ?></div>
    <div><?php previous_posts_link(‘Next Entries »’) ?></div>
    </div>

    </div>

    <?php else : ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn’t here.</p>
    </div>
    </div>

    <?php endif; ?>
    <?php get_sidebar(); ?>

    </div>

    </div>

    <div class=”clear”></div>

    <?php get_footer(); ?>

    Delete:

    <div class="postcomments">
    <table>
    <tr>
    
    </td>
    <td>
    <?php comments_popup_link('', '', ''); ?>
    </td>
    </tr>
    </table>
    
    </div>

    I’m looking to do the same thing, but there is no mention of comments in my index.php file. Where else might I find this code?

    That depends on your theme and where the reference to comments is on the viewable pages.

    Thread Starter westcountryleisure

    (@westcountryleisure)

    So is there a way to do this?

    Yep. ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove all reference to comments’ is closed to new replies.