SEO and the script tag
The script tag changes the text of a page in the visitor's browser after the page loads. It does not create any new address and it does not change your server's HTML.
What that means for search#
- One address for every language. Google recommends separate addresses for language versions rather than cookies or browser settings. A script that swaps text on
/pricinggives Google no/fr/pricingto list. See Google's guide. - A crawler does not choose a language. Googlebot usually crawls from the United States and does not send a language preference.
- Script-made content is second class. Google renders JavaScript later, with its own browser. The loader runs on a language choice or an address signal. Crawlers therefore mostly see your original language. How other search engines and link-preview tools treat scripts is verify.
- Titles, descriptions, structured data, address slugs and sitemaps cannot be translated for crawlers that do not run scripts. Do not promise translated slugs or sitemaps with the script tag.
- hreflang needs separate addresses.
- No automatic redirects. The loader never redirects by language. Google advises against it.
When the script tag is the right tool#
- Visitors who are already on your site want to read it in their language.
- You want your pages to stay readable when our servers are down.
- You cannot change the server or the platform.
When it is not enough#
If you need search traffic in other languages, use a path with real language addresses. WordPress with the plugin, Shopify, the framework kits, or your platform's own multilingual feature. Use the script tag only for the parts they do not cover.
The Google statements here were checked on 2026-10-28. Re-check every six months.