Skip to content

Translation widget SEO: languages crawlers never get

Translation widget SEO explained: why JavaScript language switchers leave crawlers with one language, and which Weglot and GTranslate modes give each a URL.

By Crawlito · 8 min read

In short

  • A client-side translation widget swaps text in the visitor's browser on the same URL, so the HTML a crawler fetches stays in the source language.
  • Weglot's Help Center says its JavaScript integration offers no SEO benefits because translations are rendered client-side and are not crawlable by search engines.
  • GTranslate's WordPress plugin page says its free version gives no SEO advantage and keeps the URL unchanged, while paid plans serve translations on sub-directories or sub-domains.
  • Google recommends a different URL for each language version and advises against using cookies or browser settings to change the content language.
  • A curl request to each language URL, followed by a search for a translated sentence, shows whether a crawler can get that language at all.
On this page

A JavaScript translation widget usually gives crawlers one language: the one your server sends. The widget waits for a visitor to pick a language, then replaces the text in the browser on the same URL. A crawler that fetches that URL gets the original HTML, and because there is no separate address for the French or Arabic version, there is nothing else for it to fetch. If you want translated pages to be found, each language needs its own URL that returns translated HTML.

This post covers how the common widgets work, what Weglot and GTranslate document about their client-side and server-side modes, how that lines up with Google's guidance, and a test you can run per language. For the wider multilingual audit, see multilingual AI readiness; for language annotations, see hreflang for AI search.

Why a JavaScript translation widget is invisible to crawlers

A client-side widget follows the same pattern whichever vendor supplies it:

  1. The server sends the page in the source language, for example English.
  2. A script loads and draws a language switcher.
  3. When the visitor picks French, the script fetches translations and rewrites the text nodes in the page.
  4. The address bar still shows the same URL.

Two things stop a crawler from ever seeing step 3.

First, there is no URL to request. Crawlers work on URLs. If /pricing is the only address and the French text exists only after a click, there is no /fr/pricing to discover, link to or list in a sitemap.

Second, the translation needs an action or a preference the crawler does not have. Google's multi-regional sites guide says Googlebot usually crawls from the USA and sends requests without an Accept-Language header. So a widget that picks a language from the visitor's preferences gets no language preference from the request, and even though Googlebot renders JavaScript, you should expect it to see the default language.

For AI crawlers the gap is wider. Vercel and MERJ's December 2024 measurements, summarised in do AI crawlers run JavaScript?, found that none of the major AI crawlers they tracked executed JavaScript, so those crawlers only read the raw HTML. The raw vs rendered HTML comparison is the right lens here: a client-side widget changes the rendered page, never the raw response.

What Google says about language versions

Google's guidance is direct on the two points that matter. In the multi-regional sites guide, Google recommends using different URLs for each language version of a page, rather than using cookies or browser settings to adjust the content language. It also warns that if you change content or reroute users based on language settings, Google might not find and crawl all your variations.

The localized versions page then explains how to connect those URLs with hreflang in HTML, HTTP headers or a sitemap, and says each language version must list itself as well as all other language versions. That only works if the versions exist as URLs. You cannot annotate a translation that lives in a script's memory.

The same page also notes that localized pages are only considered duplicates if the main content stays untranslated. A widget-only setup produces exactly that from a crawler's point of view: every language "version" is the same English HTML.

Weglot: JavaScript integration vs subdomain and subdirectory

Weglot offers both models, and its own Help Center is clear about which one is for search.

Weglot integrationWhere translation happensURL per languageDocumented SEO effect
JavaScript snippetIn the browser, on the flyNo, same page"Not SEO-friendly"
Subdomain (e.g. fr.example.com)Server side, through a reverse proxyYesEnables indexing of translated pages
Subdirectory (e.g. example.com/fr/)Server side, Weglot serves the whole siteYesEnables indexing, hreflang on both versions

The details, from Weglot's own articles:

  • JavaScript integration. Weglot's SEO article says this method does not offer SEO benefits, as translations are rendered client-side and are not crawlable by search engines. Its performance article adds that the original and translated languages are displayed on the same page, and that the JavaScript integration is not SEO-friendly. Weglot's general integration guide suggests it for the testing, developing or staging phase.
  • Subdomain integration. Translations are performed on the server side, directly in the page source, and served from a dedicated subdomain per language through a reverse proxy. Setup needs your own domain and a CNAME record for each translated language.
  • Subdirectory integration. Weglot manages the entire website, including the original version, which is what lets it add hreflang tags to both the translated and the original pages. Setup needs two DNS changes.

At the time of writing, Weglot says it adds hreflang tags automatically in the URL-based modes but does not include x-default by default, calling it generally unnecessary except for a language selection homepage. If you want an x-default fallback, Weglot says to add it manually through your CMS or host.

GTranslate: free widget vs paid sub-directory and sub-domain

GTranslate draws the same line between its free and paid products. Its WordPress plugin page says:

  • The free version has a built-in JavaScript engine that uses Google Translate machine translation, and the widget sends page text for translation from the visitor's browser.
  • With the free plugin, your website URL does not change and the translations are not stored, and the free version does not give any SEO advantage.
  • Paid versions are a translation proxy, which GTranslate calls a Translation Delivery Network, and the paid feature list includes enabling search engine indexing, translated meta descriptions and hreflang tags for the translated alternatives.

GTranslate's WordPress documentation describes the two URL structures on paid plans: sub-directories such as /es/ and /fr/ with the URL add-on installed, and sub-domains such as es.example.com with DNS CNAME records configured. Both are described as there to enable search engine indexing of the translated pages.

The Google Translate website element

Many older sites still carry the Google Translate website element, a script snippet that adds a language dropdown to the page. Like the free widgets, it is a script on the page, not a set of language URLs. Google's Search documentation on multilingual sites does not mention it, and its guidance on separate URLs per language applies to it like any other switcher. If it is still on your site, run the curl test below: if every language returns the same source-language HTML, treat the element as a convenience for human visitors and do not count it as a language version for search.

How to test each language with curl

The test is the same for every vendor: request each language URL with no cookies and no JavaScript, and look for a sentence that only exists in the translation.

bash
# Replace with your URLs and a phrase that appears only in each translation
for pair in \
  "https://example.com/pricing|Simple pricing" \
  "https://example.com/fr/pricing|Des tarifs simples" \
  "https://example.com/de/pricing|Einfache Preise"
do
  url="${pair%%|*}"; phrase="${pair##*|}"
  code=$(curl -s -o /tmp/page.html -w '%{http_code}' -A 'Mozilla/5.0' "$url")
  if grep -qF "$phrase" /tmp/page.html; then hit=found; else hit=MISSING; fi
  lang=$(grep -o '<html[^>]*lang="[^"]*"' /tmp/page.html | head -1)
  echo "$code  $hit  $lang  $url"
done

Read the output line by line:

ResultWhat it meansNext step
404 on the /fr/ URLNo URL exists for that languageLikely a client-side mode; switch to a URL-based one
301, 302 or 307The language URL redirectsRun curl -sI on it to see the Location, then test that target
200, phrase MISSINGThe URL exists but serves the source languageTranslation still happens in the browser, or the wrong template is served
200, phrase foundThe translation is in the raw HTMLCheck hreflang and the lang attribute next

Also check that the lang attribute matches the language served. A French URL that still says lang="en" usually means the template was not localized; the html lang attribute guide covers that fix. If a language URL redirects depending on who asks, read Accept-Language redirects and crawlers before changing anything else.

Finally, confirm the hreflang set is present in the raw HTML of every version:

bash
curl -s https://example.com/fr/pricing | grep -io '<link[^>]*hreflang[^>]*>'

An empty result means the annotations are not in the raw HTML. Google treats HTML tags, HTTP Link headers and sitemap entries as equivalent, so check the response headers (curl -sI) and your sitemap before concluding they are injected by script or missing.

How to fix a widget-only setup

  1. List your languages and priority pages. Start with the pages people would search for in each language: home, pricing, main services or products, and contact.
  2. Move to a URL-based mode. With Weglot, that is the subdomain or subdirectory integration. With GTranslate, a paid plan with sub-directories or sub-domains. With a CMS that has native localization, publishing translated pages directly is another route. Pick one structure; Google's multi-regional guide lists the trade-offs of subdomains and subdirectories.
  3. Link the languages with plain HTML links. The switcher should be ordinary <a href> links to the other language URLs, so crawlers can discover them without running a script.
  4. Add every language URL to your sitemap and confirm the hreflang set is reciprocal.
  5. Keep the widget out of the indexing path. If you keep a client-side switcher for unsupported languages, accept that those languages are for visitors in the browser only.
  6. Rerun the curl test for each language after the change, and again after any theme or plugin update.

Frequently asked questions

Does Googlebot see translations from a JavaScript widget?

Usually not. Googlebot renders JavaScript, but a widget that waits for a click or a browser language has no URL to crawl and no preference to act on, since Googlebot typically sends no Accept-Language header.

Is Weglot's JavaScript snippet bad for SEO?

Weglot's own Help Center says it offers no SEO benefits, because translations are rendered client-side and are not crawlable by search engines. Weglot recommends the subdomain or subdirectory integration for multilingual SEO.

Does the free GTranslate widget get translated pages indexed?

No. GTranslate says its free version gives no SEO advantage and does not change the URL. Its paid plans add sub-directory or sub-domain URLs for indexing.

Can hreflang fix a client-side translation widget?

No. Hreflang points to alternate URLs, so it needs a separate URL for each language that returns translated HTML. Without those URLs there is nothing to annotate.

Check what each language returns

A switcher that works in your browser says nothing about what a crawler receives. Once your curl test passes, run the free single-page check on a translated URL; it needs no account. For a site with many languages, a full-site audit covers up to 500 pages and returns a PDF with evidence and prioritized fixes.

Filed under Rendering and content. Topics: international-seo, javascript, rendering, hreflang