Consider taking another approach to improve SEO
Closed this issue · 1 comments
Background
Multilingual sites is a website that offers content in more than one language.
Google recommends using different URLs for each language version of a page rather than using cookies or browser settings to adjust the content language on the page.
It is recommended to use hreflang annotations to help Google identifying and and link to correct language version.
If you prefer to dynamically change content or reroute the user based on language settings, be aware that Google might not find and crawl all your variations.
It is recommended to avoid automatically redirect user to from a language version to another based on what you think user's language may be. This could prevent search engines from viewing and crawling all different language versions which can lead to worse SEO.
Finally, Google recommends websites to use Country-specific domain, Subdomains with gTLD or Subdirectories with gTLD. Simplified, use example.com and example.se, use en.example.com and sv.example.com or use example.com/en and example.com/sv. Each have their on pros and cons, read more about that on Google Search Central, Using locale-specific URL.
However, using URL parameters (example.com?loc=sv or (example.com?lang=sv) is not recommended, nor using localStorage
Source: Google Search Central
What does this have to do with this package
What I understand this package uses query
or localStorage
to store the users selected language and also redirects to users preferred browser language. This is not the recommended way for SEO and specifically Googlebot crawler.
Instead the package should be using urls to store (or at least display the selected language) and use hyperlinks to other language variants.
Disclaimer! I am not an SEO expert so please don't use this as fact, search on your own but use this as a tips.
Hi @GnussonNet,
Thank you for your contribution.
While, in general, all your points about SEO are correct, this package solves a particular use case: handling internationalisation with statically exported pages in next.js. This package operates exclusively on the client side and focuses on situations where we can not create dedicated language-specific URLs or paths for each language version on export.
I'll keep your recommendations in mind for future releases and for our architectural discussion on further improving the package, especially regarding the SEO guidelines.
Cheers,
Martin