Only show French articles on fr.website.com

Hi,

So, I translated my website using Weglot, so I have “website.com” and “fr.website.com”.

However, I choose to not translate my english blog articles via Weglot and I choose to do it manually instead.

So I have 2 CMS collection, one for english articles and another for french ones.

Thing is, on “website.com”, french articles are still accessible and it hurt my SEO since on the french articles, the hreflang is still english. And moreover, my french articles won’t rank well since they are detected as english.

What should I do? Or, is it possible to only show the french article on fr.website.com and vice versa?

You may want to consider having separate projects for each language.

Thanks, it quite bothersome :pensive:

Hey @Sharonn
It might be set this way I believe:

  1. Crate specific CMS collection for french articles only
  2. Paste this collection to specific div block with unique class name e.g. .blog–fr
  3. Add a class to your eng blog collection e.g. .blog–en
  4. Add a code which will hide .blog–fr once user see the main (lang=“en”) domain and hide .blog–en once user goes to subdomain.

The code looks like:

<style>
html[lang="en"] blog--fr {
	display:none!important;
}

html[lang="fr"] blog--en {
	display:none!important;
}
</style>

You need to paste this code in Project settings >>> Custom code.

Also you can ask Weglot support about this code of course.

Cheers.