Resource icon

xF2 Guides Custom BBCode to Force Link as Nofollow 2.2.2

No permission to download
Compatible XF 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:

nofollow-icon.png



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>
Author
Admin
Size
505 bytes
Extension
zip
Downloads
2
Views
1,850
First release
Last update

More resources from Admin

731Threads
2,287Messages
63,796Members
robertjotaLatest member
Back