-
Notifications
You must be signed in to change notification settings - Fork 156
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
hreflang integration? #1001
Comments
I also really need this functionality for the same purpose. I have multiple language and regional versions of our sites with some unique content and some content copied using distributor and then translated. Previously, the canonical URL was supposed to be sufficient. But now we need these hreflang tags and you need to have all alternative versions listed on every version. This should be relatively simple, but I'm not experienced enough to know exactly how best to do it. I made a start here:
That will add the tags of the source and the destination to the destination post. But I don't know how to get the locale of the source and I don't know how to get this to apply to the source post either. |
fixes for issue 10up#1001
With Muhammad's fix I can get this functionality working but only with pushed posts and only to the destination site, not the source site. Modified my snippet to be added in functions.php
|
@CptCrunchy24 click here to get commit for pulled post. |
PR is #1019 |
This newer version is working better. Both pushed and pulled posts are correctly including the alternate links. |
I think I'm missing something here. I understand What I am having trouble understanding is the use case for Distributor, as the original text of the post is pushed/pulled in the original language. In the Distributor case, it seems that @gleysen Is there a step that I am missing? |
@peterwilsoncc hreflang is used mostly for different languages indeed, however in my case it's also used for 2 sites that are both in Dutch. One in Belgian Dutch .. site.be , and the other one in Dutch for the Netherlands... site.nl. Both are Dutch, but when people search in Google I want the Belgian site to be shown for people from Belgium and the .nl site to be shown to people from the Netherlands. ... and the French version for people that are from Belgium but use the French version...etc. |
The use for distributor when dealing with different languages is also that it means we can produce content on one site with an English editor and then push it to a different language site where a translator will translate the post and publish it. Distributor speeds up the process and potentially automate the hreflang tags. This means we can use a translator who just translates the text and doesn't touch any images, formatting etc. and we're good to go. |
Thanks both for clarifying your use cases. |
Describe your question
I'm integrating Distributor in a setup where I have a domain.be that pusches articles to a domain.fr site, and I want to use hreflang tags instead of the standard canonical tags.
Anyone try this already? Or can give me some code tips on where to start with making these adaptations?!
(basically, on the .fr pages, there needs to be an hreflang link to the .be page, and visa versa, for SEO purposes and so that Google will rank the right page in a country.)
Thx for your help!
G.
Code of Conduct
The text was updated successfully, but these errors were encountered: