- Compatible XF Versions
- 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.
Click on Add BB code and set it up as follows:
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:
[NOFOLLOW=][/NOFOLLOW]
Now add the URL after the = sign (no single or double quote marks needed) and the anchor text after the first closing bracket:
[NOFOLLOW=https://website.com]Anchor text or page title[/NOFOLLOW]
to get this (since this is not implemented on this site, the BBcode isn't parsed here)
[NOFOLLOW=https://website.com]Anchor text or page title[/NOFOLLOW]
If you check page source, you will see this:
<a href="Create Your Website for Free | Free Site Builder | Website.com" rel="nofollow">Anchor text or page title</a>
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 codesClick on Add BB code and set it up as follows:
Then add the nofollow icon to your rich text editor toolbar:
Usage
Click on nofollow icon shown above. This inserts the following into the text editor:
[NOFOLLOW=][/NOFOLLOW]
Now add the URL after the = sign (no single or double quote marks needed) and the anchor text after the first closing bracket:
[NOFOLLOW=https://website.com]Anchor text or page title[/NOFOLLOW]
to get this (since this is not implemented on this site, the BBcode isn't parsed here)
[NOFOLLOW=https://website.com]Anchor text or page title[/NOFOLLOW]
If you check page source, you will see this:
<a href="Create Your Website for Free | Free Site Builder | Website.com" rel="nofollow">Anchor text or page title</a>