Title: Removing comment section from page.php
Last modified: August 18, 2016

---

# Removing comment section from page.php

 *  Resolved [adtfar](https://wordpress.org/support/users/adtfar/)
 * (@adtfar)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/)
 * Hi,
 * I want to remove the comment section from some of my pages (ie about me, contact).
   I am just wondering if anyone could point me in the right direction on what parts
   of the sode i should take out
 * <?php get_header();?>
    <div id=”content”> <?php if ($posts) { foreach($posts 
   as $post) { start_wp(); ?> <div class=”entry”>
 *  <?php the_content(‘Continue Reading »’); ?>
    <?php wp_link_pages(); ?> <?php
   $sub_pages = wp_list_pages( ‘sort_column=menu_order&depth=1&title_li=&echo=0&
   child_of=’ . $id );?> <?php if ($sub_pages <> “” ){?> <p class=”info”>This page
   has the following sub pages.</p>
    - <?php echo $sub_pages; ?>
 *  <?php }?>
    <p class=”comments”> <?php comments_popup_link(‘No Comments »’, ‘
   1 Comment »’, ‘% Comments »’); ?> </p> <!– <?php trackback_rdf(); ?> –> </div
   > <?php comments_template(); ?> </div> <?php } } // end if (posts) else { echo‘
   <p>Sorry, No Posts matched your criteria.</p>’; } ?> <p align=”center”><?php 
   posts_nav_link(‘ – ‘,’« Prev’,’Next »’) ?></p> </div> <?php get_sidebar();?> 
   <?php get_footer();?>
 * cheers in advance

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [pipedreamergrey](https://wordpress.org/support/users/pipedreamergrey/)
 * (@pipedreamergrey)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503499)
 * <?php comments_template(); ?>
 * Is what triggers the comments form, but did you know that you can just shut off
   the comments option?
 * There is a check box under “Discussion” labeled “Allow Comments” when you write
   a page or edit a page that can be unselected.
 *  Thread Starter [adtfar](https://wordpress.org/support/users/adtfar/)
 * (@adtfar)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503504)
 * I did realise but i didnt want the comment section closed line to appear. I just
   wanted it to be a clean finish after the text of the page.
 * I did try removing the
 * <?php comments_template(); ?>
 * but it caused my sidebar to be out of position – coming underneath the content
   section and then the footer under that….
 *  Thread Starter [adtfar](https://wordpress.org/support/users/adtfar/)
 * (@adtfar)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503506)
 * you can see this at [http://www.adisctoofar.co.uk/?page_id=9](http://www.adisctoofar.co.uk/?page_id=9)
 * any other suggestions to how to remove the comment section from the page?
 *  [pipedreamergrey](https://wordpress.org/support/users/pipedreamergrey/)
 * (@pipedreamergrey)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503519)
 * I can’t be sure of the reason for that without taking a closer look at your template.
   But, there are two potential solutions to remove that line of text. First if “
   Sorry, comments are closed for this item” is all that is bothering you, you could
   delete that line from wordpress. It’s in a file called wp-comments-post.php on
   line 15.
 * Change:
    die( __(‘Sorry, comments are closed for this item.’) );
 * to
 * die( __(‘ ‘) );
 * Or … (and this becomes a bit more involved) …
 * You could create a page template… [http://codex.wordpress.org/Category_Templates](http://codex.wordpress.org/Category_Templates)
   
   [http://codex.wordpress.org/Theme_Development#Query-based_Templates](http://codex.wordpress.org/Theme_Development#Query-based_Templates)
 * Then, create a custom comments form (comments.php) for that template that is 
   all spaces rather than a visable form.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503533)
 * Aren’t you guys overcomplicating it?
 * A clean removal of the `<?php comments_template(); ?>` line should do it. Make
   sure you do NOT touch any `div` tags around it!
 * As for removing the ‘comments closed’ or whatever it is… recommending to edit
   the core files – is a very bad practice.
    Just remove this lines on the page.
   php from the code you posted: `<p class="comments"> <?php comments_popup_link('
   No Comments »', '1 Comment »', '% Comments »'); ?> </p>
 *  Thread Starter [adtfar](https://wordpress.org/support/users/adtfar/)
 * (@adtfar)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503627)
 * thanks, all sorted… i took out the div sections before.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Removing comment section from page.php’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 6 replies
 * 3 participants
 * Last reply from: [adtfar](https://wordpress.org/support/users/adtfar/)
 * Last activity: [19 years, 4 months ago](https://wordpress.org/support/topic/removing-comment-section-from-pagephp/#post-503627)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
