Homepage doesn't have canonical URL

Long story short: it seems like the homepage doesn’t have a canonical URL tag… ?

That’s relevant when you change the hostname of the site and don’t want to redirect everything yet,

and in order to avoid search index entries like http://forum.domain.com?blahblahblah in case someone links to it that way.

6 Likes

I do not see the purpose of this request?

The only possible reason I can see for this regarding the “home” page is for “link and ranking signals” when

Your server is configured to serve the same content for the www subdomain or the http protocol.

But this can be more easily achieved on an individual basis without touching any Discourse code.

Set your preferred domain
Tell Google which version of your site’s URL you prefer for your domain:

It’s in my post.

Yes, that’s a solution for Google that can be used in case the software does not use a canonical URL.
But I see this as a last resort and a means to fix up an issue with a site. I would indeed require fixing it on an individual basis and it does not solve the ?blablah issue. And… you do know that Google is not the only search engine, right?

I see it as the first and only necessary approach and I seriously doubt its necessary at all.

Of course, but also I think being obsessed about micro-managing supposed SEO “tricks” is a major waste of time, energy and effort.

This is not about SEO tricks or being obsessed.

It’s about people changing their hostname or domain name and after three months they find out that search engines picked up that change perfectly except for their home page, which is now twice in the search engine index.

I’m a bit confused here since the necessity seems very clear to me. I see this topic has even been reclassified as a feature, while I’m convinced that the code path for the home page just forgets to call canonical_url

1 Like

This seems like such a bad idea, I’m not sure why anyone would want to encourage it?

Not encouraging, but supporting it would be desirable.
One specific example where this would be handy is to have a soft launch of a rebranding, where you want to communicate the new URL to search engines before communicating it to the customers.
(Real life example)

Another thing is that a third party can cause a search engine issue by causing duplicate content issues by linking to your home page with arbitrary parameters.

This is caught on every page of a Discourse installation except for the home page - because of the fact that the call to canonical_url is just omitted there. I would make a pull request if I was able to determine the exact code path for the home page…

3 Likes

@michaeld Hello!

Ya, this happens. I can confirm this. Another reason, why we may like to have canonical for the Homepage is the permalink /latest and / shows and index duplicate content.

Similarly, I have been trying hard to noindex via GTM but yet I’ve not been able to see effect.

I hope to noindex these common pages from first day of Discourse installation.

1 Like

url like /latest?exclude_category_ids%5B%5D=20&exclude_category_ids%5B%5D=19&no_definitions=true&page=1 is be index by google, seems meanless to user