How to Completely Remove Comments from a WordPress Website
May 10th, 2017 | by Ravi Chahar || 4 Comments |
To get rid of the spam comments, you can completely remove comments from a WordPress website. You can also disable comments for WordPress posts and pages.
But it’s not the permanent solution. You can remove the comment form from the WordPress theme you’re using.
You may have seen many websites which don’t have any commenting system. Many are using any other commenting system than the default one.
But if you have decided to build a comment free website, you can remove comments from a WordPress website with many methods.
Editing the WordPress Theme File
The first method is to edit the theme files. If you know about the WordPress theme file structure, you would be aware of the single.php and the page.php files.
In most of the WordPress themes, the single.php file handles the structure of the single posts where page.php file is responsible for the page you show on your WordPress website.
Depending on the coding of your WordPress theme it may vary. Every WordPress theme developer has his/her own coding style.
You can ask your developer about that.
To edit these two files, you can either use an FTP account, the cPanel or directly from your WordPress admin panel.
From admin panel, navigate to Appearance>>Editor>>single.php or page.php file
You should know that to show a comment form on your WordPress website, a WordPress codex is used. let me show you the code.
This is the default use of this code. It can consist a few more parameters.
You have to find this code in both the files and remove it.
NOTE: Do that only if you have expertise in coding.
After removing this code, if you see any error, you can fix it by adjusting the PHP code. Though most probably, there wouldn’t be any error.
With this method, you have removed the comment form showing codex of your WordPress theme.
Change the Comment Form File Name from the Theme Folder
You can completely remove comments from a WordPress website by removing the comments template code. What if you want to adopt any other method?
Do you know which the file is responsible for showing the comment form on any WordPress theme?
It’s the comments.php file. This file has the code which generates all the functioning of the comment form.
If you remove this file, the comment form will automatically get disappeared from your WordPress website. But it can be risky to many.
Not everyone is a techie person. Instead of removing it, you can edit the name of this file and create a new blank file with the same name.
It’s because WordPress searches for the comments.php file to show the comment form. And if you create a blank file then nothing will appear.
To do that, you have to either use an FTP account or the cPanel account provided by your web hosting.
Login to your cPanel account and navigate to file manager>>wp-content>>themes>>theme name>>comments.php file
It’s possible that the file may be present in any folder named “comments”. It’s up to your web developer.
But for a clean WordPress theme, it will be present directly in the theme folder.
Replace it with something else. Maybe comments_disable.php.
Now whenever WordPress fetches the comment form, it wouldn’t show anything. It’s possible that an error may appear.
To maintain the functionality, you have to create a new blank file and name it comments.php.
Save it and you’re good to go. You have successfully removed the comment form from your WordPress site.
Use a Plugin to Completely Remove Comments From a WordPress Website
Yes, this is the simplest method. WordPress is for all. Whether you’re a techie person or not, you can fix everything using WordPress plugins.
Install and activate Disable Comments plugin. Go to Settings>>Disable Comments and you will reach to the plugin setting configuration page.
You will see the options to disable comments only for pages, posts or both. You can also choose an “everywhere” option to disable comments from everything of your site.
This plugin has another option to delete all the existing comments. If you can want to make your website comment free, you can use it otherwise, just disable them.
I hope this article was helpful. If you still have any doubt, feel free to clear it.