How do you disable commenting on articles in Drupal?
To disable comments in Drupal 8, there are two parts.
Using Drupal Admin
- First of all, login to your Drupal admin area
- Now, go to the Administrator tab, then Content tab and finally click on the Content Types.
- Now, click and edit the content type you prefer to disable the comments for.
- Lastly, you must ensure the comments are on ‘OFF’ mode by default
If you’re using Drupal 7.x/8.x use the following method to disable the comments:
- Login to your admin area
- Go to Structure -> Content -> Types ->Comment Settings
- Select the option 'Closed' present under 'Default comment setting'
- Save the changes
By executing an SQL query
Deleting/disabling the comments can also be executed by the SQL query in the phpMyAdmin. Here are the steps to follow:
Execute this SQL query in your database
UPDATE system SET status = ‘0’ WHERE filename = ‘modules/comment/comment.module’;
If you would like to reverse the effect, i.e. enable comments at a later stage, simply change the SET status = ‘1’
BY Best Interview Question ON 12 May 2020