How to add Nofollow to Drupal comment links

Profile picture for user devraj

In Drupal, it is straightforward to add no-follow to Drupal comment links. All you need to do is select a checkbox for a text editor. Below steps are tested for Drupal 9.

Step 1: Navigate to Configuration -> Text Formats and Editors

drupal add no follow for comments

Step 2: Click on Configure for Editor you have provided to the comment to Guest. In my case, I have provided Basic Editor.

Drupal add no follow for comments links

Step 3: Scroll to the bottom. You will find Filter Settings. Here in Tab Limit, allowed HTML tags and correct faulty HTML select checkbox Add rel="nofollow" to all links

Drupal No follow for comment editor

Step 4: Click on Save Configuration

Step 5: Verify Link contains no follow by adding a comment by selecting a basic editor. you will see rel="nofllow"

<a href="" rel="nofollow">test link</a>