How to Add rel="nofollow" to Links?

General Discussion
  • You can enable HTML. Not sure if you can enable it only for specific users.

  • I just tested it and it works.

    I installed nodebb-plugin-sanitizehtml, enabled it, and enabled HTML (from Plugins -> Markdown -> Allow HTML).

    $ npm install nodebb-plugin-sanitizehtml
    

    Then changed the settings for "allowed attributes" to:

    {"a":["href","name","target","rel"],"img":["src","class","alt","title"]}
    

    and "allowed tags" to:

    ["h1","h2","h3","h4","h5","h6","blockquote","p","a","ul","ol","nl","li","b","img","i","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre"]
    

    Now this should work:

    <a href="http://amazon.com/" rel="nofollow">Amazon </a>
    
  • @vstoykov said in How to Add rel="nofollow" to Links?:

    hen changed the settings for "allowed attributes" to:

    Thank You for helping me out.

    Should I just fill the array of allowed tags in the first blank? Sorry for the noob query.

    0_1481362004229_nofollow.jpg

  • You should enter the array of tags and the array of attributes.

    If you forget to add "rel" in the array of allowed attributes, it would not work. You can copy my examples, I mentioned above:

    Settings for "allowed attributes":

    {"a":["href","name","target","rel"],"img":["src","class","alt","title"]}
    

    Settings for "allowed tags":

    ["h1","h2","h3","h4","h5","h6","blockquote","p","a","ul","ol","nl","li","b","img","i","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre"]
    

    Or you can enable only the "a" tag:

    Allowed attributes:

    {"a":["href","name","target","rel"]}
    

    Allowed tags:

    ["a"]
    
  • @vstoykov

    Thank you ...will use the mentioned settings.

    I came to know that by default NodeBB uses nofollow tags for all outgoing links through markdown.

    If it is the case, i would be happy with that single plugin.

  • A lot of nofollow link is a big no no, As google might consider you as a guy who don't want give back something for any other guy. Link juice is important, but saving everybit of link juice is unnecessarily unimportant and unimpressing for google bro.

  • The current version of NodeBB is adding "nofollow" to all external links. Testing this:

    https://community.nodebb.org/

    How to disable this feature? I want "nofollow" only on some links.

  • I found out how to do it:

    Plugins -> Markdown -> [ ] Tell web crawlers that external links are not to be followed
    
  • @revir said in How to Add rel="nofollow" to Links?:

    If you want to promote something, you should use the widget to add html code to that page, or write a template. Like what I did for my website, see the footer of the page, there are a lot of outgoing links, the crawler can index those.

    Why link something that you don't want to promote? Seems like odd behaviour. Your are promoting it, but then get spiteful? I can understand some very specific moments that something might need to be linked quietly and there is no intent for people to visit the page. But by and large, if someone is promoting something, pretending that they are not is weird. If you truly don't want it to be promoted, just don't link it.

  • @srinik said in How to Add rel="nofollow" to Links?:

    But, you know as per SEO one should use nofollow tag for unnecessary links.

    What's an unnecessary link? I think that the best approach is to eliminate unnecessary links, rather than linking and then trying to hurt their SEO after having utilized them as a reference.


Suggested Topics