Join Tom Geller for an in-depth discussion in this video Manage comments, part of Drupal 8 Essentials 2: Building Out Your Website.
- [Voiceover] In another video, you saw how to configure policies for comments on your site. But once it's up and running, you'll need to deal with the comments themselves to separate the good from the bad from the completely spammy. First, let's step back to a control I mentioned in that other video. To go to it, we go to People and Permissions. And then scroll down to the Comment section. I'm going to allow anonymous users to both post comments and to skip comment approval.
Now, of course, that's opening my site wide open to all sorts of abuse. But that's fine because we'll take care of it. Scroll to the bottom. And click Save Permissions. Now I'm going to switch over to another browser where I'm not logged in. So I'll see the site as a visitor would see it. That is, an anonymous user. If I scroll down, I see that it's requiring me to log in or register to post comments, but that's just because I haven't reloaded this page. When I do, I see that I now can add a new comment.
I'll go down to Jacob Mars here and Add New Comment. And my comment will be, "I love his work. "Visit my site at example.com." Something that's probably spam. And then save. Now, if I go back to my administrative browser, and then go back to the front page and look at that note, I see yup, there's a new comment. Let's take a look at it. Ooh, there it is and I didn't do anything to stop it. Now, it's important to notice that you got no other notification as the administrator.
You didn't get an email saying that there was a new comment. However, it does show up in a list under Content and Comments. And there it is. So you could actually come here and just look over this list once in a while and weed out the ones that are no good. For example, I could select it by clicking this check box and then choosing Unpublish the Selected Comments. Or I could actually delete it directly. But let's say that I just wanna un-publish it. Now it shows up in Unapproved Comments. This is sort of like an unpublished note, but for comments.
Now let's change those permissions back a little bit and take a closer look at the approval process. To do that, we go to People and Permissions and then scroll down again to the Comment area. And turn off Skip Comment Approval for Anonymous Users. And, of course, save. Now let's go back and post the same comment in the same note as that visitor. I'll reload the page. Of course, we hid that earlier comment, but I'm gonna just add it again as the spammers want to do.
And save. Now you'll notice this warning at the top. Your comment has been queued for review by site administrators and will be published after approval. And if we scroll down, it's not there. But if we go back to the administrative interface, of course we go to Content and Comments again, there it is. It's now in the Unapproved Comments list. So those are Drupal's basic tools for managing comments. But they're somewhat incomplete. For example, you don't get any notification when someone posts an unapproved comment. It just sits there in the queue until you think about it and look at it.
So I recommend adding a free Drupal module to notify you. As I'm making this video, it's unfortunately not yet available for Drupal 8. But I imagine it will be available soon, so just keep checking back. Finally, there are several free Drupal modules available to throw roadblocks in the way of potential spammers. To find those, again we go to Drupal.org, Download and Extend, and Modules. Then once there, we filter by Drupal 8. And under Module Categories, scroll all the way down toward the bottom and choose Spam Prevention and Search.
It's hard to reach a balance because anything that gets in the way of spammers will also get in the way of good contributing members of your site. This is a problem way bigger than Drupal, of course. And Drupal, to its credit, gives you some great tools to find the balance that's right for you.
In these tutorials, Tom Geller helps new Drupal designers change the layout and design elements of their sites, control visitor interactions (including comments), arrange content in user-friendly "views," and expand the site's capabilities beyond what's available in core Drupal with Drupal modules. In all the steps you'll learn best practices to ensure your sites remain streamlined, secure, and up to date.
If you want to start from the beginning and create your Drupal site from scratch, check out Drupal 8 Essentials 1: Getting Started.
- Grouping content into categories
- Managing comments
- Adding discussion groups
- Customizing fields and image styles
- Adjusting menus and navigation to help users
- Adding new features with Drupal modules