Add rel="nofollow" admin setting is not working right, its making parent domain link as nofollow

We are going to need an extra site setting.

if forum.ninjas.co.uk then www.ninjas.co.uk should be followed.

if beta.forum.ninjas.com then www.ninjas.com should be followed.

So we need a site setting here for:

follow_links_domains which user can set. Which will help for lots of other cases. Like ninjas.community wanting www.ninjas.com followed.

3 Likes

Yes this only applies to the domain part of the URL.

However, I think our default behavior is correct now.

meta.discourse.org should only include follow for a.meta.discourse.org etc. Otherwise we need to carry around logic that tells us who is a TLD

eg:

.community vs .com vs co.uk vs co.il

OR we need to do DNS queries and add extra complex logic.

1 Like

No we don’t need to do any of that, we just need to add one more site setting: it contains

discourse.org

or

example.com
example.co.uk
example.website

We know that anything with a period added to the front of that is allowed. If this setting is not specified, then nofollow is super strict.

Note that @techapj said he fixed a bug with the current handling that seems kind of severe…

So we need that fix…

1 Like

Sure, just saying current behavior is correct.

Also site setting should allow for a list of domains, not just one.

According to @techapj current behavior is not correct (at least for exclude_rel_nofollow_domains)

Yes, I agree. However I think we should just rename setting exclude_rel_nofollow_domains to follow_links_domains, because exclude_rel_nofollow_domains is essentially doing the same thing. So:

  • By default meta.discourse.org will only follow meta.discourse.org, a.meta.discourse.org, etc.
  • If the user adds discourse.org to follow_links_domains setting then meta.discourse.org will also follow discourse.org, www.discourse.org, try.discourse.org, etc.

Sounds good?

1 Like

I think this is fine:

https://github.com/discourse/discourse/commit/93ab03966ea9395f86b39fded3ef8f70e274857a

I don’t want rename this site setting, seems pointless.

4 Likes

Is it fixed? If I upgrade to latest version will it work or do I need to wait for next release?

Also do I need to do anything for old posted links or ‘no-follow’ will automatically get removed from older root domain links?

It works fine but you need to plugin the domain name into the site setting

1 Like

@sam its working fine for newly add links but for older content it is still adding rel=“nofollow”, please suggest how can I remove rel=“nofollow” for all the older content for my parent domain?

Rebake the previous content – look up the command to rebake all posts.

3 Likes

Thanks a lot, it work like a magic :smile:

1 Like

Sorry guys I am a newbie with nofollow and have a question: I want to take content from by blog on my normal site and also post it as a thread on my discourse site which is a subdomain of my main site (animalhearted.com vs. community.animalhearted.com). Do I need to add a rel cononical tag to each thread I post individually so that google won’t penalize me for having duplicate content on my site? Please let me know what I need to do in order to post duplicate content and not get an seo dock from google.

Thanks so much!

Typically what’s done is the embedding feature, which will put a short excerpt on Discourse with a “Show Full Post” button.