I have a “Contact Us” page on AggieCampusology.com and a “Share a Story” page, and in the default WordPress setups, Pages include the ability to post comments, just like a regular Post does. But that doesn’t make any sense on a “Contact Us” or “Share a Story” page, where users are already being presented forms to be filled out, and I was worried about users getting confused, so, I wanted to remove the comments section from those pages completely, if I could.
The solution is:
1. Create a custom page template.
2. Remove the “comments” code from that template.
3. Use the new Custom template for the pages you don’t want comments on.
Hopefully the following is a decent enough explanation, if you want to do the same yourself:
- Copy the “page.php” file in your theme directory.
- Call the new copy of “page.php” “custompage.php” or something similar.
- Open “custompage.php” in your text editor, and replace it’s contents with this:
<?php
/**
Template Name: CustomPagePage template, without comments at the bottom.
*/get_header(); ?>
<div id="container">
<div id="content" role="main"><?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_front_page() ) { ?>
<h2 class="entry-title"><?php the_title(); ?></h2>
<?php } else { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php } ?><div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
</div><!-- #post-## --><?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #container --><?php get_sidebar(); ?>
<?php get_footer(); ?>
*Note: all the above really does is duplicate the template called “loop-page.php” removing this code:
<?php comments_template( '', true ); ?>
**Note: you can also just download the above code from here, if you’d like to see it a little more cleanly. - Save the “custompage.php” file.
- Open the page you want the comments removed from in the WordPress Admin UI.
- On the right under “Page Attributes” change the template from “Default Template” to “CustomPage”:

- Click “Update” to save the new settings.
- Check your new pages in a browser, to make sure everything works the way you want it (specifically that there are no longer “comments” at the bottom of your commentless pages!
If you want to read up more on creating your own page templates for WordPress, check the codex.
Oh, and sidebar here: I’m using TDO Mini Forms to power the “Share a Story” page on AggieCampusology.com, because I wanted a quick and easy way for users to submit entries, that will work with the publishing workflow that’s naturally included with WordPress, without making a user “register” or anything… seems to be working so far…