How to Add rel="nofollow" to Links?



  • Hello!

    How to add rel="nofollow" tag to outgoing links in the post?
    As of now, I'm using the inbuilt link generator to post a link.
    But, you know as per SEO one should use nofollow tag for unnecessary links.
    Please do help me to do it.


  • Global Moderator

    Do you want nofollow on all links?

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

    I don't see why that would be the case, unless you want to hide your site from other sites. If this was added to the Markdown plugin, it would be an all-or-nothing thing. Otherwise, a custom plugin for your specific use case will be necessary.


  • Plugin & Theme Dev

    I think the default markdown plugin has properly handled this, set the config "tell web crawlers that external links are not to be followed" true would add rel="nofollow" tag to outgoing links.



  • @revir
    @PitaJ

    I would like to add rel="nofollow" only on affiliate links.....not all links.

    Say for example I'm promoting a book or pen then I do want to have nofollow tag on that outgoing link.

    Please let me know the procedure.


  • Plugin & Theme Dev

    no, I don't know why you would like that, I think all posts' external link should be not followed, I actually appreciate NodeBB has this feature, a lot of websites ignore this, there are so many SEO rubbish contents filled those sites.

    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.



  • @revir

    Actually, I would like to promote Amazon products by making a review on it. So would like to add nofollow tag to that affiliate link in the post where I review the product.

    Kindly guide me how to do it.



  • 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://www.youtube.com/
    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
    

Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.