Introduction: Drupal Core Comments + ReCaptcha & Disqus
This Tutorial will show how to enable Comments on content type nodes in Drupal 8, adding ReCaptcha anti-spam protection. D8 admins can add HoneyPot for anti-scriptBot protection.
Optional: The Tutorial also includes installing the Disqus comments platform as an alternative to the Drupal 8 core comments system which may be advantageous to some web publishers.
The Drupal 8 core module system cannot be used at the same time with Disqus comments. Disqus is a third-party start-up widget that plugs into the Drupal 8 CMS to extend functionality.
Drupal 8 publishers will need to make a meta-decision as to whether to use Drupal 8 core comments with ReCaptcha anti-spam or install Disqus as a comment solution for any website.
Step One: Install the Drupal Comment System on Content
Start: Navigate to the modules section of Drupal 8 administration at admin/modules & enable the Comment module. Most Drupal 8 websites install with this enabled as the default setting.
Next: Comment settings can be turned on/off individually for each content type. Navigate to /admin/structure/types/manage/*/fields to edit the settings for each content type.
Advanced: Under the settings available at admin/structure/comment administrators can customize the theme settings for comments, building custom templates for different displays.
Finish: Customize the Comment form settings & on-page display for each Drupal 8 content type individually according to the needs of your website’s theme, then add anti-spam protection.
Step Two: Install ReCaptcha Anti-Spam Protection on Forms
Start: Download and install the ReCaptcha anti-spam module for Drupal 8 comments. Administrators will need to register with ReCaptcha to use the module with Drupal 8.
Note: The HoneyPot module adds an extra layer of protection against automated script-bots.
Configuration: Install & enable the three modules as usual in Drupal 8 administration, then navigate to admin/config/people/captcha/recaptcha in order to configure the ReCaptcha settings on comments & other forms.
Configuration: The HoneyPot module can be configured by navigating to: admin/config/content/honeypot & enabling “Protect all forms” or Comment forms specifically.
Configuration: Choose Comment forms from the list of options for HoneyPot protection.
Configuration: The ReCaptcha service requires users to register every domain at: https://www.google.com/recaptcha/admin
Configuration: Register your website with ReCaptcha, then enable ReCaptcha verification on comment forms in the administration section at: admin/config/people/captcha/recaptcha
Configuration: Generate a ReCaptcha API key then enter the Site Key/Secret Key values in the module form. Choose the ReCaptcha theme color & difficulty level for user challenges.
Finish: Save the settings and load a Drupal 8 page as anonymous in a browser. The ReCaptcha anti-spam challenge should display in comments for anonymous users but not administrators or site editors. The HoneyPot module functions automatically in the background.
Step Three: Review the Permission Settings for User Roles
Start: For web security & theme requirements, review the Permission settings for Comments according to User Roles in Drupal 8 admin at: admin/people/permissions
Configuration: It is recommended to grant the permission to comment on nodes to registered users and not to anonymous users. Remember to review D8 website user registration settings.
Finish: Grant the Comment permission to the required User Roles, then save the new settings. Anonymous users should see a “Register to comment” link to the sign-up page.
Step Four: Install Disqus Comments for Content Types
Optional: Some Drupal 8 web publishers may prefer to use the Disqus comment system on nodes instead of the default Drupal 8 core comment system with ReCaptcha anti-spam.
- Advantages: Disqus is a professional comment system well recognized by users across many websites with shared login capabilities & independent comment mediation.
- Disadvantages: The comment content is managed on Disqus web servers & off-site domain tools rather than through Drupal 8 administration & the local production server.
Note: In order to install Disqus comments on a Drupal 8 website, it is recommended to uninstall the Drupal core Comment module in administration (unless it is already in use with the forum module or other pre-requisites). Then download & install the Disqus module files, enabling them in the Drupal 8 administration section as usual. Otherwise, override the Comment settings on a node-by-node basis to use Disqus on some content types only.
Start:Disqus is a drop-in replacement widget for Drupal 8 core comments, but administrators will need to register their websites with Disqus at: https://disqus.com/admin/create/
Configuration: After registering the website, return to: admin/config/services/disqus
Configuration: Add your website’s shortname, user access token, & secret/public keys to the Disqus module settings panel & save. Use Google Analytics to track comments as an option.
Advanced: Use the domain tools at Disqus to moderate content: https://disqus.com/admin/
Finish: Navigate to node pages and test the Disqus module display. Drupal 8 administrators have the option to configure Disqus to display on any content type or let it degrade gracefully.
Conclusion: Disqus vs. Drupal 8 Core Comment System
Summary: Comments are a fundamental aspect of multi-user blogs, social networking, & e-commerce websites, requiring Drupal 8 web publishers to choose D8 core or Disqus.
Recommendation: The Drupal 8 core comments system vs. Disqus debate involves advantages/disadvantages, i.e. theme professionality & off-site management of content data.
Important: Use the ReCaptcha & HoneyPot modules together with core Drupal 8 comments for advanced protection against spam & script bots that can be customized in administration.