statamic / seo-pro

An all-in-one site reporting, metadata wrangling, Open Graph managing, Twitter card making, sitemap generating, turn-key addon for Statamic.
https://statamic.com/addons/statamic/seo-pro
52 stars 36 forks source link

Improve canonicalization #151

Open fabbow opened 3 years ago

fabbow commented 3 years ago

Hi there!

It would be great if the addon could feature cleaner canonicalization than it does now :)

The short version:

If my page is noindexed, we want neither a canonical tag, nor an hreflang tag.

If my page is set to be indexed but has a not-self-referencing Canonical, we do not want hreflang

Currently, these do not care about each other. When I set a page on my multilingual Statamic to noindex and apply a GET param, what I have is a page that sends mixed signals and implements hreflang incorrectly.

The longer versions:

https://www.searchviu.com/en/hreflang-canonical/

https://www.seroundtable.com/google-noindex-rel-canonical-confusion-26079.html

ranuss commented 3 years ago

Are the set canonical tags right by default? It always shows the current URL which is not right in my opinion. If i have two different URLs for a site, it should set only the main URL in the canonical tag.

fabbow commented 3 years ago

What do you mean by two different URLs for a site, can you ship an example? For what it's worth, I've since stopped using SEO Pro due to this and hreflang issues and use the SEO partial that Rob has created for the Peak Kit (or just Peak itself when the project wants Tailwind).

ranuss commented 3 years ago

https://example-domain.com/example-content/

https://example-domain-alias.com/example-content/ => the canonical should point to https://example-domain.com/example-content/

fabbow commented 3 years ago

Yeah sure, that's technically wrong and the canonical should probably factor in the APP_URL

I guess very few people run this kind of setup and that's why it hasn't been changed yet

ranuss commented 3 years ago

Would be great to have this fixed.