{"date":"2016-11-23T09:48:18.000Z","inputPath":"./src/blog/posts/2016/2016-11-23-wordpress-code-completely-disable-comments-using-functions-php.md","fileSlug":"wordpress-code-completely-disable-comments-using-functions-php","filePathStem":"/blog/posts/2016/wordpress-code-completely-disable-comments-using-functions-php","outputFileExtension":"html","url":"/wordpress-code-completely-disable-comments-using-functions-php/","outputPath":"_site/wordpress-code-completely-disable-comments-using-functions-php/index.html"}

WordPress: Disable Comments

How to completely disable comments using functions.php

The code below will completely disable any commenting and trackback features in WordPress. It is in response to the usual issue whereby you think comments have been completely turned-off only to get a notification that there are a new comments waiting moderation.

This code won't turn off any "This post has X comments" or front-end code that displays comments that may be in your theme. Instead it removes the ability for comments to be added/stored against posts. To remove front-end comment boxes and listings you'll need to change your individual templates

Simply copy and paste into your functions.php file in your WordPress theme folder.

Ready to elevate your WordPress site?

Whether you're launching a new site, strengthening security, or integrating WooCommerce, I can help transform your vision into a high-performing online presence.

Contact me to discuss your WordPress project