Resource icon

XF 2 Tip Custom BBCode to Force Link as Nofollow 1.0

No permission to download
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.

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:
custom-bbcode-to-force-link-as-nofollow.png
custom-bbcode-to-force-link-as-nofollow-1.png
custom-bbcode-to-force-link-as-nofollow-2.png

Then add the nofollow icon to your rich text editor toolbar:
custom-bbcode-to-force-link-as-nofollow-3.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="https://website.com/" rel="nofollow">Anchor text or page title</a>

Suggestions for improvements to this are welcomed. :)
Author
ENXF NET
Downloads
3
Views
1,109
Last update
Rating
0.00 star(s) 0 ratings

More resources from ENXF NET

Top