Hreflang defaults to root

Posting on behalf of a customer so don’t have to many details on version installed etc.

I tried looking at the documentation but the page seems dead: A guide to translation and internationalization in Ghost

Essentially, we have all our pages default to the root international version (see screenshot).

Screenshot 2024-02-08 at 16.57.47

Example, on the homepage (i.e. greatwebsite123.com) the settings in the screenshot should be the correct ones. But I’ve actually taken out the screenshot from a page like greatwebsite123.com/category/page etc. and it’s set up like this sitewide.

Instead, I’d obviously like each page to be using the corresponding URL instead. So I imagine it’s an implementation issue because based on other threads I’ve seen here, this can be done.

Could anyone please advise what could be wrong here?

You may want to take a look at @cuongtran 's theme, which is set up to do multilingual. Publish articles in multiple languages . However, I think it requires a Ghost install for each language, from looking at his documentation.

I’m brain-fogged today due to COVID (yuck) and am probably not reliable for anything that matters today, but I have some thoughts on some hacky solutions that might make this possible in one Ghost install. It’d involve using an internal tag to group all posts with the same content and another internal tag that would give the language - then you could do a #get request for the other posts with the grouping tag and determine which language each one is, then write out all those link tags programmatically. It’d probably be fussy and sensitive to tag order, and depending on how else your theme uses tags, it might blow things up, since you’d be adding a new tag per post grouping.

Another option would be to manually create these links and drop them in each post’s individual code injection header. Then you could wrap some logic around the handlebars used to write out this content in your screenshot to ONLY write it out for the specific index pages where you need it.

One other option: I worked with one client who actually had one post per article, and all the translations were published as part of the same post. Each translation was wrapped with HTML cards (but beyond that, posts were normal posts and editable with the normal Ghost editor). Some css & javascript made one language visible at a time. I don’t know enough about multilingual SEO issues to know what Google thought about this approach. I didn’t set it up, just did some work for them when it got messed up by an update.

1 Like