WordPress comments offer a great opportunity to engage with your site visitors. At WPBeginner, we love to encourage our readers to share their thoughts and spark discussions in the comments section.
However, turning off WordPress comments can be a smart move for many reasons. Sometimes, you don’t want comments on certain posts, pages, or custom post types. Other times, you might want to remove comments altogether.
In this article, we’ll guide you through the steps to disable comments in WordPress. We’ll go over several different ways you might want to do this. Our instructions will be straightforward and easy to follow, no matter your specific needs or skill level.
Why Disable Comments in WordPress?
There are many reasons why you might want to turn off comments on specific posts or pages or disable comments on your whole website.
For example, bloggers may publish certain posts like announcements that they don’t want to allow comments on. In these cases, you can easily disable comments on those specific posts or pages.
Many small business owners use WordPress to create their websites. These business websites often don’t have a blog section and mostly have static pages like services, about us, contact, etc. In such cases, allowing comments at all doesn’t make sense.
Another common scenario is that some business blogs disable comments entirely to prevent spam. Although you can always use spam protection techniques (which we’ll share later in this article), disabling the comment section will definitely solve the problem.
While comments are a great way to boost engagement and get feedback from your readers, managing them can be time-consuming. This is especially true if you’re dealing with a lot of spam or negative comments.
Whatever your reason may be, you can certainly disable comments and even remove the comment section from your WordPress site entirely.
In the following sections, we’ll explain how you can disable comments on pages, posts, or media with and without using a plugin. Here’s a quick overview of what you’ll learn in this article:
- Completely Disable Comments
- Disable Comments on Future Posts
- Disable Comments on a Specific Page or Post
- Disable Comments on Pages and Posts in Bulk
- Delete All WordPress Comments
- Disable Comments on Media Pages
- Disable WordPress Comments Using a Free Plugin
- Remove 'Comments Are Closed' in WordPress
- Bonus Tip: Make Your Comments Section More Engaging
- More Bonus Tips: Spam Protection Techniques
Ready? Let’s get started with a video tutorial.
Video Tutorial
If you prefer written instructions, then continue reading.
Completely Disable Comments
It’s very easy to completely disable comments and remove all comments-related features from the admin panel as well as the front end of your website.
The free WPCode plugin comes with a library of pre-configured code snippets, and you can use the ‘Completely Disable Comments’ snippet to remove all traces of them from your site.
Simply install and activate WPCode, and then navigate to Code Snippets » Library in your WordPress admin panel. Here, you can search for ‘completely disable comments’ and hover your mouse over the result named the same thing.
You can then click on ‘Use Snippet.’
WPCode will then take you to the ‘Edit Snippet’ page, where the plugin has already configured everything for you.
All you need to do is toggle the switch to ‘Active’ and click ‘Update.’
Now, WPCode will disable all comments-related features from your website.
If you prefer to remove all comments manually from your site, you can paste the following code into your theme’s functions.php file.
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_safe_redirect(admin_url());
exit;
}
// Remove comments metabox from dashboard
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
// Disable support for comments and trackbacks in post types
foreach (get_post_types() as $post_type) {
if (post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
});
// Close comments on the front-end
add_filter('comments_open', '__return_false', 20, 2);
add_filter('pings_open', '__return_false', 20, 2);
// Hide existing comments
add_filter('comments_array', '__return_empty_array', 10, 2);
// Remove comments page in menu
add_action('admin_menu', function () {
remove_menu_page('edit-comments.php');
});
// Remove comments links from admin bar
add_action('init', function () {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
});
Note: Pasting code snippets directly into your theme files should only be done by advanced users, as editing your core WordPress files can easily break your site.
Disable Comments on Future Posts
If you’ve just started your WordPress site, you can easily stop comments on your future posts.
To do that, go to Settings » Discussion from the left sidebar of your WordPress admin panel.
On this page, you need to uncheck the option that says ‘Allow people to post comments on new articles’ and then click on the ‘Save Changes’ button to store your settings.
This will disable comments on all your future posts. However, if you want to allow or disallow comments on a specific post, then you can still do it without changing this setting.
We’ll cover that in the next section.
Disable Comments on a Specific Page or Post
By default, comments are turned off on all your pages.
However, WordPress gives you the freedom to enable or disable comments on individual pages and posts.
Simply head over to Pages » All Pages from the left sidebar. On the next page, you need to hover your mouse cursor over the title of a page that you want to enable or disable comments and click the ‘Edit’ link.
From here, you’ll want to make sure you’re on the ‘Page’ tab on the right-hand panel.
Then, you can click on ‘Open’ next to ‘Discussion.’ This will open a popup box, and you need to make sure the ‘Discussion’ box is closed here.
Once you do that, you can hit the ‘Save’ button to apply your changes.
You can follow the same process to turn off comments on individual posts or other custom post types.
Disable Comments on Pages and Posts in Bulk
Want to disable comments on all your published posts and pages without doing it individually? You can do that without the use of a plugin.
First of all, you’ll want to go to Posts » All Posts to see all your articles.
Next, you can select all the posts, choose ‘Edit’ from the ‘Bulk Actions’ dropdown box, and click ‘Apply.’
You’ll now be able to perform bulk actions on all the posts selected, including changing the author name and turning off comments for all the selected posts.
Simply select ‘Do not allow’ from the comments dropdown box and click on the ‘Update’ button. This will disable comments on all the selected posts.
You can follow the same process to turn off comments on your pages.
Delete All WordPress Comments
While the above methods will disable comments on your posts and pages, they will not remove the existing comments from your WordPress site.
To delete all the comments from your site, you can click ‘Comments’ from the left sidebar of your admin panel.
Next, you’ll want to select all the comments, choose the ‘Move to Trash’ option from the ‘Bulk Actions’ dropdown box, and click ‘Apply.’ This will delete all the existing comments from your site.
If your website has a lot of comments, then you will have to repeat this step multiple times because WordPress only displays a certain number of comments per page.
Disable Comments on Media Pages
If you are looking to disable comments on media attachment pages, then there are 2 ways to go about it.
You can manually disable comments on individual media attachment files by following the methods we discussed above, but that can be really time-consuming.
The easier way to bulk disable comments is by using a code snippet. If you’re an advanced user, you can paste the following code into your theme’s functions.php
file. However, we don’t recommend this method as editing core files can break your WordPress site easily.
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == 'attachment' ) {
return false;
}
return $open;
}
add_filter( 'comments_open', 'filter_media_comment_status', 10 , 2 );
We recommend that everyone use WPCode, the simplest and easiest way for anyone to add code to their WordPress site.
Simply install and activate the free WPCode plugin. For more information, you can see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you’ll want to head over to ‘Code Snippets’ in your WordPress dashboard. Then, simply hover your mouse over ‘Add Your Custom Code (New Snippet)’ and click the ‘Use Snippet’ button.
Next, you will see the ‘Create Custom Snippet’ screen.
Here, you can give your snippet a title such as ‘Disable Comments on Media Pages’ and paste the code above into the ‘Code Preview’ area.
Note: Be sure that you have ‘PHP Snippet’ selected from the dropdown menu under ‘Code Type’ and the switch toggled to ‘Active.’
Now, you can simply press the ‘Save Snippet’ button, and the code will be live on your site.
Disable WordPress Comments Using a Free Plugin
If you don’t want to disable comments manually, then you can use the Disable Comments plugin with just a click.
It allows you to completely disable comments everywhere on your WordPress site. You can also disable them on specific post types like posts, pages, media, and others. It also removes the comment form and stops displaying existing comments.
The first thing you need to do is install and activate the Disable Comments plugin. You can follow our step-by-step guide on how to install a WordPress plugin for detailed instructions.
After activating the plugin, let’s head over to Settings » Disable Comments from the left sidebar of your admin panel.
Selecting the ‘Everywhere’ option allows you to disable comments on your entire WordPress site. The plugin will also remove the comments menu item from your WordPress admin area.
If you select the second option of ‘On Specific Post Types’, then you can selectively disable comments on your posts, pages, or media.
For example, if you want to remove comments only from the media attachments, then you can select ‘On Specific Post Types’ radio button and then check the ‘Media’ checkbox.
You can do the same if you only want to turn off comments on WordPress pages. Using the plugin is the easiest way to disable comments on WordPress pages.
When you’re done, simply click ‘Save Changes’ to complete the process.
Remove ‘Comments Are Closed’ in WordPress
If your WordPress theme is not checking the comment status properly, then it may still display the comment form and existing comments or even show the ‘Comments are closed’ message.
You can ask your theme developer to fix this because this is not a standard compliant approach.
Alternatively, you can also try fixing it yourself by following the instructions below.
First, you’ll want to connect to your WordPress site using an FTP client or the File Manager in your WordPress hosting control panel. Next, you can navigate to your current theme folder, which will be located in /wp-content/themes/
folder.
In your theme folder, you need to locate the comments.php
file, right-click on that file, and rename it to comments_old.php
.
Next, you need to right-click in the right panel of your FTP client and select the ‘Create new file’ option.
Then, simply name your new file comments.php
and click the ‘OK’ button.
This trick simply serves as an empty comments template for your WordPress theme, so no comments or comment-related messages will be shown.
If your WordPress theme does not have the comments.php
file, then you need to ask your theme developer which file you need to edit.
Bonus Tip: Make Your Comments Section More Engaging
You may not need to switch off your comments section when you can make it more lively with a plugin like Thrive Comments. It’s one of the best WordPress plugins to boost activity and engagement in your comment sections.
Do note that all plugins by Thrive are available through the product manager. So, to get started, you’ll need to create a Thrive account.
In the Thrive dashboard, you can download and install the Thrive Product Manager plugin .zip
file.
From here, you can install the plugin using the ‘Upload Plugin’ feature in WordPress. If you need help, you can refer to our guide on how to install a WordPress plugin.
Then, you can activate Thrive Comments and start exploring its features to make your comments more engaging.
In the following sections, let’s see several ways Thrive Comments can make your comments section more engaging.
Allow Users to Like or Dislike Comments
Thrive Comments includes cool features like liking and disliking, which makes interacting more fun.
The upvote/downvote system not only makes your blog more interactive but also shows what topics your audience likes the most. It helps keep the comments section useful by pushing down negative or spammy comments.
For example, if a negative comment gets a lot of dislikes, it will get buried, making it less visible and less likely to be seen by others.
Allow Users to Edit Their Comments
Allowing users to edit their comments on your WordPress site is important for fixing mistakes like typos or grammar issues. Sometimes, users might also want to add or remove content from their comments.
By default, WordPress doesn’t let users edit their comments, which can be annoying. This is where Thrive Comments can help.
Plus, it’s a good idea to set some rules for comment editing, like a time limit of 5 or 10 minutes. This helps prevent spammers from adding unwanted links later and keeps the comment thread fun for everyone.
Allow Users to Subscribe to Comments
Allowing people to comment on your WordPress blog is a great way to boost engagement. However, users often leave comments and do not come back.
When you let users subscribe to comments, they’ll get email alerts whenever someone else comments on the same post.
This keeps them interested and encourages them to return to your site. Plus, comment subscriptions let people follow.
More Bonus Tips: Spam Protection Techniques
If you’re planning to disable WordPress comments to protect your site from spammers and link builders, consider using some of these techniques to combat spam instead.
Akismet
Akismet is one of the best plugins for dealing with spam comments. The best part is that it was built by the WordPress team.
This plugin checks each comment on your site and verifies whether it’s spam or not. For more details, you can check out our guide on the Akismet plugin.
Closing Comments
Did you know that you can close comments after a certain period of time?
Head over to Settings » Discussion and check the field that says ‘Automatically close comments on articles older than 14 days.’
This will automatically close the comments form after 14 days. You can also change the number of days based on your needs.
Typically, spammers target older posts, so several users change this setting to 180 days, which significantly reduces spam.
Honeypot with Antispam Bee
On WPBeginner, we have found it helpful to add a second plugin called Antispam Bee which works alongside Akismet to significantly reduce comment spam on your site.
It adds an invisible honeypot that blocks 99% of spam bot comments.
Comment CAPTCHA
Adding a CAPTCHA or reCAPTCHA to your comment form is not user-friendly, but it helps you protect your site from spammers.
You can use the CAPTCHA 4WP plugin to add reCaptcha just before the submit button of your comment form.
Remove Website URL Form Field
Another way to deal with link builders and spammers is to remove the website URL field from the comment form. Many spam comments are from bots and users simply looking for a link back to their site.
You can also use Comment Link Remove and Other Comment Tool for this purpose. This plugin allows you to remove the website URL field from your comment form without touching a single line of code. Isn’t that great?
Blocking Bad IPs
You can also block bad IP addresses from accessing your WordPress site. This will help you to block spammers and hacking attacks.
To do that, you can check our guide on how to block IP addresses in WordPress.
We hope this detailed guide helped you to understand how to completely disable comments in WordPress with and without using a plugin. Next, you might also want to see our guide on how to delete all pending comments or how to allow users to report inappropriate comments in WordPress.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Dayo Olobayo
Thanks for the different options you have carefully explained. But while disabling comments can make sense for some websites, it’s worth noting that comments can also boost SEO by adding fresh content and engagement. I will advise website owners, especially those with low traffic, to focus on moderation instead.
Dennis Muthomi
Based on my experience, the SEO impact isn’t that massive – but it surely helps, especially for sites with lower traffic volumes like mine.
Moderation is certainly an option, but it can be time-consuming, especially if you get hit by a lot of spam or troll comments.
At the end of the day, it’s a trade-off between SEO value and managing that extra workload.
Jiří Vaněk
It’s not just about SEO. Comments on a blog are also great because they add new knowledge to topics from users. If WordPress is set up, for example, with a plugin that allows searching within comments (which it doesn’t do natively), it can enhance user experience, as users can gain additional insights from comments alongside information from articles. Furthermore, comments deepen relationships between users and help create a community. In my opinion, rather than focusing solely on SEO, comments are primarily beneficial for building relationships, fostering good communication, and supporting community engagement. However, I understand that in some cases, such as in a personal portfolio, comments may be considered undesirable.
yeswitha
Thanks for sharing easily to understand. Nice blog
WPBeginner Support
You’re welcome, glad we could make this easy to understand
Admin
Jiří Vaněk
Is it possible to ban comments only on a certain category or tag? For example, if I have a category on the website under which there will be articles and I don’t want comments there. Can individual categories or tags be banned this way?
WPBeginner Support
We do not have a simple way at the moment but we will be sure to share if we find an easy method we would recommend
Admin
Jiří Vaněk
Thank you for answer. Alternatively, I will keep an eye on your articles to see if any possibility appears over time. It’s great that you then retroactively update older articles as well.
Max
Thanks you so much, really useful.
WPBeginner Support
Glad we could share how to do this
Admin
Chris McBrien
What a great resource. This was exactly the answer I was looking for. Thank you!
WPBeginner Support
You’re welcome, glad it was helpful!
Admin
Bradley Maravalli
Additional PHP code on how to get rid of the comment icon within the admin bar.
// Remove comments icon from the admin bar
add_action( ‘wp_before_admin_bar_render’, function () {
global $wp_admin_bar;
$wp_admin_bar->remove_menu(‘comments’);
});
WPBeginner Support
Thank you for sharing this snippet
Admin
Shawn Bourque
Excellent article, thank you. Exactly what I was looking for, and installing the WPCode plugin then following the steps did precisely what I was trying to do. Thanks again!
WPBeginner Support
Glad our guide was helpful!
Admin
Waldemar
Thank you very much! With that code I removed that useless backend voice from my sites.
WPBeginner Support
Glad our guide could help!
Admin
Steve
Thanks for the video. Turning off comments in bulk is not working for me. I followed the steps and it shows, but I keep getting comments. Any suggestions?
WPBeginner Support
You would want to check where the comments are on your site and see if the comments settings for the specific post/page that they are being added to is not set to disable comments.
Admin
Steve
Ok, but the point of the video is to turn off comments globally. That is what I am trying to accomplish. I don’t want anymore comments on my site. Any suggestions?
WPBeginner Support
Correct, following our guide you should no longer have any comments. If you are still receiving comments then you would want to check the specific page/post you are receiving comments on in case that specific page has settings that would override the global settings.
This could happen if you missed the page in the bulk edit option or if you accidentally changed the settings when editing that post or page.
Elliot Jolesch
Excellent article, and provided me with several options.
Why would or should I use Akismet instead of Disable Comments?
The site in question has been designed purely as a “yellow page” display ad, with some text and images of work done.
WPBeginner Support
Akismet is a tool to help reduce spam if you want to keep the comments available to your users instead of completely closing them.
Admin
Mr. Tom
Great ways and thank you. But, how we should do to prevent someone that they are trying to insert link on comment body with html tag and css modification for color?
Todd Hampson
Very good instruction! Simple, clear and well-paced.
Usman Ashraf
Greetings,
How can I remove comment counter in my blog?
WPBeginner Support
You would want to check with the support for your specific theme if that is not hidden when comments are disabled.
Admin
Chin
I disable the comment under discussion why still have the comment box on my post?
WPBeginner Support
You may have another setting for the specific post overriding or a plugin conflict may be adding the comment area.
Admin
MARYA
How can I disable the comment box on a single product page?
WPBeginner Support
On the product page when you are editing it in the admin area of your site there would be the option to disable comments.
Admin
Mario Noliya
I have disabled comment from setting>discussion but still comment is visible on previous posts. how can i remove these on previous post or what is the manual process to remove these comments
WPBeginner Support
You would either want to use the plugin or manually update the old posts and pages to disable the comments.
Admin
Engela Edwards
Thank you. Your directions and screen shots were very clear and easy to follow. I am grateful for your help.
WPBeginner Support
Glad our guide was helpful
Admin
Harry
The comment section/box is a form. You just need to disable it. You can do this through Appearance > Customization > Additional CSS. Just right-click and inspect your comment box to find its id or class (you actually need to find the id or class of its correct parent div). Then you disable like this:
#idname { display: none; }
Evidently, “idname” is the name of the correct id you’ve found.
For example, if you inspect this very comment box, you’ll see that it’s a element and it has a element as a parent. Then if you go up you see this p element is a descendant of a form, which is a child of a div with a “respond” id. If you hide this div, you’ll see that this comment section disappears.
WPBeginner Support
While this is technically an option if none of the other options work, it does not remove the comment form it only hides it which means it can still be found by spam tools that crawl pages for the comments section.
Admin
Javed
suprer helpful.
WPBeginner Support
Glad you found our guide helpful
Admin
zanu
Nice And Great Article post it is very helpful and useful for me Thanks For Sharing
WPBeginner Support
You’re welcome
Admin
Sam
Very helpful, ty!
WPBeginner Support
You’re welcome
Admin
Moosa Khan
Thanks to its are very helpfull
WPBeginner Support
Glad our article was helpful
Admin
robrt smith
I think employing a plugin was an honest idea if your website has many posts and much of latest ones coming daily except for a little blog or sites, it are often done manually.
WPBeginner Support
You’re correct, if you’re just starting and never want comments then you can do this manually. The plugin is mainly for if removing comments was decided later
Admin
M S
Thank you for a very clear and easy to follow tutorial.
My only question however would be, how to I stop the words ‘no comment’ appearing next to each post?
Thank you.
M.
WPBeginner Support
It would depend on where this is located. If you reach out to your theme’s support they should be able to let you know what options they have available.
Admin
Craig Ancel
Hi,
This was very simple, clean, clear way to help me disable post comments on my site!
Great work
WPBeginner Support
Thank you, glad you found our content helpful
Admin
Sowjanya
Good article thanks for the article
Keep sharing
WPBeginner Support
Glad you like our article
Admin
Labib Muahammad Jamal
Thank you
Keep it up.
WPBeginner Support
You’re welcome, we’ll keep writing articles
Admin
mobileninja
It is a very good way.
WPBeginner Support
Glad you like our recommendation
Admin
Manish Sharma
I think using a plugin was a good idea if your website has lots of posts and lots of new ones coming daily but for a small blog or sites, it can be done manually.
WPBeginner Support
That is another option, the plugin is to ensure someone does not forget to disable the comments on a post
Admin
Marya
It is a good tutorial and article. Thank you
WPBeginner Support
You’re welcome
Admin
Alice Elliott
Why you should be encouraging people to close or disallow comments on their blogs and websites beats me! This may be necessary for pages, but certainly not for posts! We should be encouraging commenting as much as possible, and educate them in spam moderation and how to overcome trolling behaviour. Even the simple ability to close comments after a number of days will keep the spammers down to a minimum. But closing comments completely is an absolute no-no.
I note you don’t allow URLs with your commenting – so I will not be benefiting from this comment in any way apart from expressing my disgust!
WPBeginner Support
It is a personal preference for if someone should use comments. If someone lacks the time or does not want to have comments on their site, this is an option for them. This guide is to show them how to do it, not recommending it for every site
Admin
Manish Sharma
I don’t want visitors to comment on my site even on my posts.
Imagine a job posting site… you probably don’t want to see comments below every job post but for a blog like wpbeginner comment makes sense.
It depends on the type of website. and…
Links in comments generate lots of spam sometimes even they are nofollow some people or bots just want to post a link in the comment for improving their SEO rankings.
Dave
Alice, The majority of my clients are corporations using WordPress as a CMS, oftentimes using Posts for a News section or the like. They have no interest in engaging readers via a comment section. That’s what they use Facebook and Twitter for, and it’s why they publish their WordPress content to those platforms. It only makes sense to shut down the commenting feature completely.
Not every WordPress site is a personal blog.