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.

Related WordPress Posts

July 2024

Bitnami WordPress on AWS Lightsail

The Bitnami package for WordPress provides a quick one-click install solution for WordPress. Once installed you'll most likely need to replace the default install with... Continue reading

January 2024

Creating a brand-promoting brochure website with WordPress

In today's digital age, establishing an online presence is crucial for businesses looking to promote their brand effectively. One powerful tool for achieving this is... Continue reading

November 2023

WordPress for charities and donation websites

In an era where digital presence is paramount, charities are increasingly turning to online platforms to raise awareness and funds for their causes. WordPress, with... Continue reading

More WordPress Posts