-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide shadow articles in Sitemap + Canonical Link Tag #7288
Comments
Regarding the comment in the modified code about the query strings. Could be that it is specific to our use case, but in general it's not good for SEO that the query string is included. I modified another part in the seo.html.twig template to also strip the query string from the canonical:
This is also easily solvable in the sitemap template, however it would be nice to also be able to configure this. |
I'm not sure if it was a good decision to create automatically a And so I think we should remove maybe this line from the
@chirimoya what do you think? |
@alexander-schranz good question. In the case of |
Sadly could not yet find official google webmaster example about such cases. weglot does list example for In some blog posts like here it is mention if there is a canonical there should be no hreflang example here (https://translatepress.com/hreflang-canonical/), but the offical google webmaster docs mention in the canonical docs to also add all other relevant links like hreflang: https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls?hl=de 🤔 . See it specially from the homepage example you normally undependently if it is a shadow index both and not create a canonical. Andso the Based on comments google decides by its own if a hreflang is a canonical indexed or not (https://support.google.com/webmasters/thread/72181388/duplicate-content-linking-concerns-between-com-and-co-uk-sites?hl=en) and decides then show the correct url based on the users locale. |
Our main problem is: If But for anyone coming in through a search, I want them to land on the original page. Google should think that only the original page exists. (We were also told by an SEO Expert regarding the canconical and sitemap, exactly as I described. I myself am also having some trouble finding sources for all this 🤔 ) |
Actual Behavior
We have blogposts that are not translated, but we do have two localse ("de" and "en). We still want the "de" blogpost to be accessible on the "en" Website. For this we configured the "en" version as a Shadow Article.
The "en" version is considered the same as "de" and should NOT show up in the canonical, instead it should just have the "de" as a canonical.
I was able to solve this by overriding
sulu/vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Resources/views/Extension/seo.html.twig
.The "en" Shadow Article should also not show up in the sitemap.xml. I was not able to easily solve this without overriding a bunch of services.
"Deleting" the "en" version is not a solution, since then it won't be accesible on the "en" version of the website.
Expected Behavior
Do not show Shadow Articles as a canonical alternate / use the original language as a canonical+alternate.
If I have an article with "de" and "en" versions, and the "en" version is a shadow page. I expect the following link tags.
On https://www.fusonic.net/de/blog/machine-learning-vorhersage:
On https://www.fusonic.net/en/blog/machine-learning-vorhersage:
The behavior if the "en" actually has a translated version is correct.
Steps to Reproduce
Create an Article in two languages, and configure one as a shadow article.
Possible Solutions
As mentioned, I was able to solve the canonical meta tag myself by overriding the template.
Regarding the Article in the sitemap; since SULU already has the option to Hide an Article from the Sitemap, it should actually be easily solvable. If an article translation is a Shadow Article -> automatically toggle 'Hide in Sitemap'.
The text was updated successfully, but these errors were encountered: