I'm Trying to completely disable WordPress Comments. I have manually disabled comments via the WordPress back-end setting and I also created a new blank file called "no-comments-please.php" and then I added the below to my functions.php. Yet the comments show up in their numbers.

add_filter( 'comments_template', 'remove_comments_template_on_pages', 11 );
function remove_comments_template_on_pages( $file ) {
if ( is_page() )
$file = STYLESHEETPATH . '/no-comments-please.php';
return $file;

2 Answers 2


You might as well go the whole nine yards & use Disable Comments. In addition to a complete lock down, the plugin will remove any comment related sections in the admin.


Comments can be enabled or disabled for each individual page and post.

The comments setting you've toggled already controls the default behavior for NEW pages/posts. It doesn't change the comments settings on pages/posts that already existed.

Go edit the Pages and Posts and turn off the ability to post comments on them individually.

All your code does is to not display the comments form. Spammers don't use the form, they send the data directly to the comments-posting file. You need to turn off the ability to receive comments so that nobody can comment on a given page/post.

  • I already did that Otto
    – Dz.slick
    Jun 26, 2013 at 19:38
  • If you had disabled comments on each post/page individually, then you wouldn't be able to get comments on them anymore, from any source.
    – Otto
    Jun 27, 2013 at 13:47
  • That's really what's driving me crazy.
    – Dz.slick
    Jun 27, 2013 at 15:02
  • 1
    Did you also disable "pings"? These are known as pingbacks or trackbacks, and they can appear to be comments as well.
    – Otto
    Jun 27, 2013 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.