Resource icon

Unmaintained Custom BBCode to Force Link as Nofollow

No permission to download
Compatible XF 2.x versions
  1. 2.2
In Xenforo 2.2.1, all external links for all usergroups are nofollow by default.

For specific groups, this can be overridden at AdminCP >> Groups & permissions >> User group permissions >> General permissions >> {selected usergroup} >> Bypass "nofollow" in submitted content links

On certain forums, I have used this so that links posted by specified usergroups like admins are set to dofollow (this was the default in older versions of Xenforo).

But there may still be occasions, for example links in paid promoted posts, where it is desirable to force links in the post to be nofollow even for groups which bypass that setting.

This custom BBCode allows you to do that.

Create Custom nofollow BBcode​

I have attached the exported XML file for this BBcode. However, to do this manually, in case you want to customize your local version, first go to AdminCP >> Content >> BB code >> Custom BB codes

Click on Add BB code and set it up as follows:

add nofollow bbcode 1.png

add nofollow bbcode 2.png

add nofollow bbcode 3.png

Then add the nofollow icon to your rich text editor toolbar:



Click on nofollow icon shown above. This inserts the following into the text editor:


Now add the URL after the = sign (no single or double quote marks needed) and the anchor text after the first closing bracket:

[NOFOLLOW=]Anchor text or page title[/NOFOLLOW]

to get this (since this is not implemented on this site, the BBcode isn't parsed here)

[NOFOLLOW=]Anchor text or page title[/NOFOLLOW]

If you check page source, you will see this:

<a href="" rel="nofollow">Anchor text or page title</a>

Suggestions for improvements to this are welcomed. :)
First release
Last update
0.00 star(s) 0 ratings

More resources from djbaxter

Top Bottom