Drupal Comments Tutorial
How to manage user comments in Drupal
By default, in Drupal registered users can post comments. The default settings allow anonymous users (visitors) to view comments and authenticated/registered users to post and view comments. This also depends on the particular content type. For example, the default settings for the article content type allow registered users to post comments, while the basic page content type has this option disabled. From the admin panel of your Drupal application you can edit, unpublish and delete comments that have already been posted; you can change the permissions for the user roles, so that you can disable the comment functionality for a role, or you can give more permissions for that role when it comes to comments. You can also change the global settings for any content type in order to enable/disable comments or change other comment settings, and you can change the comment settings only for particular items (nodes) from a content type.
Editing, Unpublishing, Publishing and Deleting Comments
As we mentioned, registered users have the permission to post comments without admin approval by default. The default permissions allow anybody to view the comments, but only administrators can edit them. To check and edit all the comments that have been published on your Drupal site, log in to the admin panel, click on the Content tab in the navigation bar and on the page that opens click on the Comments sub-tab that's above the top right corner of the page. The page that opens shows in a table all the published comments. In the right corner of the page there are two small buttons: Published comments and Unapproved comments. If you unpublish comments, you can see and publish, delete or edit them by clicking on the Unapproved comments button.
On the page with the published comments you can use the Update Options drop-down menu to unpublish or delete comments. You can do this with many comments at the same time; just mark the checkbox in front of the comment(s), select the action from the drop-down menu and click on the Update button that's next to the menu. Keep in mind that unpublished comments won't be visible to visitors or authenticated users (they'll be visible only to administrators), but you can restore them at any time. While if you delete them, they will be completely removed and can't be restored.
If there are unpublished/unapproved comments, you can click on the Unapproved comments tab and use the same drop-down menu to restore/publish comments or to delete them permanently.
You can also click on the edit button for a particular comment. This will allow you to edit its content, title, the author and submission date, or to unpublish or delete it. After you click on the edit button for a comment, you'll be taken to the frontend where you can edit the subject and the content of the comment. If you click on the Administration button that's just above the subject of the comment, some other options will appear allowing you to unpublish the comment, to change the Authored by and Authored on information, etc.:
After you edit the comment don't forget to click on the Save button at the bottom of the page.
Another way to edit a comment is to use to links that are under the comment itself. After you log in and you view the full content of an article by clicking on its name, if there are any comments they will be displayed too. Under each comment there should be some links: delete, edit, reply.
The edit link will bring you to the same edit srceen as the one we previously desrcibed.
Changing Comment Permissions
Another thing you can do is to change the comment permissions for the different user roles. Needless to say, the administrator role has the permissions to do anything, and as we mentioned anonymous and authenticated users can view comments, while authenticated users can also post comments (without admin approval). To change these permissions, in the admin panel click on the People tab in the navigation bar, and on the page that opens click on the Permissions sub-tab that's in the right top corner of the page. On the following page srcoll down to the Comment section and edit the permissions for the desired user roles:
For example, you can edit the permissions so that authenticated users are not allowed to post comments, or can post comments with admin approval. Or, for instance, you can remove the post and view permissions for authenticated users and the view permission for anonymous users, so that nobody except for administrators will be able to view and post comments. On the other hand you can give more permissions instead of restricting them. For example, you can allow authenticated users to edit their own comments.
If you make any changes, don't forget to click on the Save permissions button at the bottom of the page.
Changing Comment Settings of Content Types
You can also manipulate where comments can be posted or not by editing the settings for the content types. The preconfigured article content type, for example, is open to comments by default; of course, assuming you haven't disabled the Comment module, or edited the role permissions. You can edit the global settings for the article content type (or for any other content type) and change the comment settings for that content type. To do this click on the Structure tab in the top navigation bar of the admin panel. On the page that opens click on Content types:
On the following page click on the edit button for the particular content type (e.g. article):
On the next page you'll see the global settings of that content type. Scroll down to the bottom of the page and click on the Comment settings section that's on the left. Some settings will appear. You can use the drop-down from which you can select Open, Closed, and Hidden to disable or enable comments for that content type. If you want to disable them select Closed, and if you want them to be enabled select Open:
Beneath this drop-down menu there's another one labeled Comments per page. You can use this drop-down menu to set the maximum number of comments per page (it's set to 50 by default). From the other settings you can disable/enable the comment title, you can change the setting for the preview, you can choose whether the reply form should be displayed on the same page as the comments, etc. If you make any changes don't forget to click on the Save content type button.
You have to keep in mind that the changes to most of the settings will apply both to future publications of content items from that content type, and to existing ones as well. The exception is the option for enabling and disabling comments. When you change this option in the global settings for the content type it will apply only to future publications; items that have already been published won't be affected. So, if we use as an example the article content type which is open to comments by default, articles that have been published before you disable comments for the article content type will be open to posts, and the existing comments for those articles will be there too. But the comment function will not be active for articles that are published after you disable comments for the article content type.
In this case, if you want to disable/enable comments for articles that have been published before the change in the global settings, you have to edit the settings of the particular article(s). Open the options for the article by selecting Edit from the drop-down menu that's in the right top corner of the article:
You can also open the options for an article by clicking on the Content tab in the navigation bar, and then on the page that opens on the edit button for the particular article.
On the page with the options, srcoll down to the bottom, click on the Comment settings section and you'll see that the only comment settings available are for disabling and enabling comments:
If you select Closed, the comment functionality will be disable, but existing comments will still be displayed. If you select Hidden, the functionality will be disabled and existing comments will not be displayed. Open, of course, is for enabling comments. Don't forget to click on the Save button.