Control "nofollow" URLs

Control "nofollow" URLs 2.2.3

No permission to download

tonnyz

Member
You can't control follow / no follow attributes with CSS.


Hi @Chris D @Fred. , will this add-on still give "follow" to set usergroup as well as retain the "nofollow" effect on mod and admin resulted by editing message.php as @Fred. posted before ?
v
v
v
Ok, I'm using this now.

Nofollow for everyone (Also Moderators and Administrators)

Edit this file:
library/XenForo/ViewPublic/Helper/Message.php

find
HTML:
        $options['states'] += array(
            'noFollowDefault' => $options['noFollow']
        );

and replace with
HTML:
        $options['states'] += array(
            'noFollowDefault' => true
        );

Thanks to Jake
http://xenforo.com/community/threads/make-all-links-nofollow.28833/

It's not ideal to edit files, but this is the only option now.
 

tonnyz

Member
@Chris D
I think internal link (link in our website which is directing to other place in our website) will have an additional point for the SEO. CMIIW

Will "no follow" also cause us to lose chances for getting internal link SEO point ?

thx in advance :)
 

Chromaniac

Well-known member
Ok, I'm using this now.

Nofollow for everyone (Also Moderators and Administrators)

Edit this file:
library/XenForo/ViewPublic/Helper/Message.php

find
HTML:
        $options['states'] += array(
            'noFollowDefault' => $options['noFollow']
        );

and replace with
HTML:
        $options['states'] += array(
            'noFollowDefault' => true
        );

Thanks to Jake
Make all links nofollow

It's not ideal to edit files, but this is the only option now.
Nice. I am assuming that XenForo does not have a functions.php in WordPress like feature where we can make this a permanent thingy that is not overwritten on updates?
Could not locate a plugin so I guess I would need to add this to the list of things to process after all XenForo updates. Thanks!
 

dutchbb

Well-known member
Thanks very useful. This is only affecting posts and sigs, any chance it can include public profiles in the future?
 

Chris D

XenForo developer
Staff member
It's been a while since I looked at it; I suspect with the location of the code that would need to be extended to do this, it may not be possible. I will have another look, though.
 

Triops

Well-known member
Any chance Chris that you have a look at the same time to include a whitelist? Please, please ;)

Thank you Chris for this important addon! For vB I used the noox Link Optimizer (http://www.vbulletin-germany.org/showthread.php?t=6104, German) which allowed detailed tweaking of rel=nofollow for many different situations.

One feature from noox which I would whish to have in your addon too would be an additional white- and a blacklist for single URLs:
  • the whitelist contains n URLs, which are never nofollow - never mind, who posted them (Admin, Mod, the usergroups granted in your addon...)
  • the blacklist is opposite - these URLs are always nofollow, even if they are posted by a granted usergroup.

Imagine other own or partner sites: these URLs should get always follow backlinks, even if they are posted by guests or other non granted user groups. The more, the better.
And of course there are websites, which should never get follow links for any reasons. Even when granted user groups post them. They are allowed to post most URLs as followed, but not those few which we should never support.

Its relevant!
Could you consider it for a future release?
 

dutchbb

Well-known member
Got these 2 errors today, think it is from this add-on but not sure.

Code:
ErrorException: Undefined index: user_group_id - library/XenForo/Model/User.php:1716
Gegenereerd Door: Onbekend Account, 34 minuten geleden
Stack Trace
#0 /home/bodyforum/public_html/library/XenForo/Model/User.php(1716): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/bodyforum...', 1716, Array)
#1 /home/bodyforum/public_html/library/ControlNoFollow/Listener.php(33): XenForo_Model_User->isMemberOfUserGroup(Array, Array)
#2 [internal function]: ControlNoFollow_Listener::templateCreate('thread_view', Array, Object(XenForo_Template_Public))
#3 /home/bodyforum/public_html/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#4 /home/bodyforum/public_html/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'thread_view')
#5 /home/bodyforum/public_html/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('thread_view', Array)
#6 /home/bodyforum/public_html/library/XenForo/ViewRenderer/Abstract.php(265): XenForo_Dependencies_Public->createTemplateObject('thread_view', Array)
#7 /home/bodyforum/public_html/library/XenForo/ViewRenderer/HtmlPublic.php(80): XenForo_ViewRenderer_Abstract->createTemplateObject('thread_view', Array)
#8 /home/bodyforum/public_html/library/XenForo/FrontController.php(607): XenForo_ViewRenderer_HtmlPublic->renderView('XenForo_ViewPub...', Array, 'thread_view', NULL)
#9 /home/bodyforum/public_html/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#10 /home/bodyforum/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
Aanvraagstatus
array(3) {
  ["url"] => string(165) "https://forum.bodybuilding.nl/index.php?topics/****-bijna-world-of-warcraft-gekocht.229285/"
  ["_GET"] => array(1) {
   ["topics/****-bijna-world-of-warcraft-gekocht_229285/page-3999999_1_union_select_unhex(hex(version()))_--_and_1=1"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

Code:
ErrorException: Undefined index: secondary_group_ids - library/XenForo/Model/User.php:1721
Gegenereerd Door: Onbekend Account, 38 minuten geleden
Stack Trace
#0 /home/bodyforum/public_html/library/XenForo/Model/User.php(1721): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/bodyforum...', 1721, Array)
#1 /home/bodyforum/public_html/library/ControlNoFollow/Listener.php(33): XenForo_Model_User->isMemberOfUserGroup(Array, Array)
#2 [internal function]: ControlNoFollow_Listener::templateCreate('thread_view', Array, Object(XenForo_Template_Public))
#3 /home/bodyforum/public_html/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#4 /home/bodyforum/public_html/library/XenForo/Template/Abstract.php(82): XenForo_CodeEvent::fire('template_create', Array, 'thread_view')
#5 /home/bodyforum/public_html/library/XenForo/Dependencies/Public.php(239): XenForo_Template_Abstract->__construct('thread_view', Array)
#6 /home/bodyforum/public_html/library/XenForo/ViewRenderer/Abstract.php(265): XenForo_Dependencies_Public->createTemplateObject('thread_view', Array)
#7 /home/bodyforum/public_html/library/XenForo/ViewRenderer/HtmlPublic.php(80): XenForo_ViewRenderer_Abstract->createTemplateObject('thread_view', Array)
#8 /home/bodyforum/public_html/library/XenForo/FrontController.php(607): XenForo_ViewRenderer_HtmlPublic->renderView('XenForo_ViewPub...', Array, 'thread_view', NULL)
#9 /home/bodyforum/public_html/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#10 /home/bodyforum/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
Aanvraagstatus
array(3) {
  ["url"] => string(165) "https://forum.bodybuilding.nl/index.php?topics/****-bijna-world-of-warcraft-gekocht.229285/"
  ["_GET"] => array(1) {
   ["topics/****-bijna-world-of-warcraft-gekocht_229285/page-3999999_1_union_select_unhex(hex(version()))_--_and_1=1"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:

Mr Lucky

Well-known member
@Chris D
I think internal link (link in our website which is directing to other place in our website) will have an additional point for the SEO. CMIIW

Will "no follow" also cause us to lose chances for getting internal link SEO point ?

thx in advance :)
Quite possibly gain advantage as Google can otherwise see the links as spammy, especially in signatures that are optimised with keywords.

https://support.google.com/webmasters/answer/66356
 

Chromaniac

Well-known member
hah. just found this. i do not want to remove myself as staff but want my links to be nofollow because i do post a lot of links that are promotional in nature. trying to find a good solution for this.
 

Chris D

XenForo developer
Staff member
You've posted in this thread before, about 7 years ago.

This add-on is for XF1 and for obvious reasons is no longer supported or relevant.

It didn't work by removing yourself as staff, it worked by adding a permission that affected whether "nofollow" was applied or not.

XF 2.2 implemented this natively:
 

Chromaniac

Well-known member
ooo. should have known this. this fixed it. though had to pick never instead of no. which i should investigate using analyze permissions. thanks a lot for this.
 
Top