Multilingual search with Weglot

Build multilingual search with Weglot

Monocle Search works best when every translated page has its own stable, crawlable URL. With Weglot, that means using the Weglot subdirectory integration so translated pages live under paths such as /fr/, /de/, or /es/.

That setup is better for search than a JavaScript-only translation layer. With Weglot subdirectories on Squarespace, Squarespace returns translated HTML for each language URL, so the translated text is present in the server-rendered response. Monocle can crawl those pages directly, index the translated titles and body copy, and show results in the language your visitor is already reading.

Use this shape for most multilingual sites:

  1. Configure Weglot to use subdirectories, not subdomains.
  2. Let Monocle crawl the root site and the translated language paths.
  3. Create one Monocle search lens per language path.

Weglot documents the subdirectory setup in How to use subdirectories with Weglot. That setup gives each language a URL such as example.com/fr/ and makes the translated content available in the HTML response for that URL.

Use subdirectories instead of subdomains

Prefer language paths like these:

example.com/
example.com/fr/
example.com/de/

Avoid a subdomain setup like this unless you have a specific reason to run separate sites:

fr.example.com
de.example.com

Subdirectories keep all languages under the same host and URL tree. That matters for Monocle because the crawler can discover and index the translated pages as part of the same site, and search lenses can use simple path rules such as /fr* and /de*.

Subdomains can still be valid for some SEO strategies, but they require a separate Monocle account (and subscription) for each language subdomain. If your translated content already lives on language subdomains, contact support before setting up Monocle Search.

Make translated pages discoverable

After Weglot is configured, check that translated pages are available without relying on a visitor's browser language, cookies, or client-side language switcher state.

The crawler should be able to request a URL such as this:

https://example.com/fr/a-propos

and receive a French HTML page in the response.

Before relying on the index, verify these details:

  • Language links or the sitemap expose the translated URLs.
  • The translated text appears in the first HTML response, not only after browser-side JavaScript runs.
  • The Monocle crawl has run after the translated pages are available.

If a language is missing from results, first open a translated page in a private browser window and confirm the translated text is present in the page source. Then run a fresh crawl from the site page in Monocle.

Create one search lens per language

Without lenses, a search from a French page could return English, German, and French results mixed together. That is rarely what visitors expect.

Use search lenses to keep each translated section searching inside its own language path.

Suppose your site has these languages:

example.com/       English
example.com/fr/    French
example.com/de/    German

Start with the Default lens for English. In Pages to include or exclude, exclude the translated sections:

# Exclude French pages
/fr*

# Exclude German pages
/de*

Then create a French lens with these settings:

  1. Set Paths where this lens should be used to /fr*.
  2. Enable the search surfaces that visitors use on French pages.
  3. In Pages to include or exclude, exclude everything and then bring French pages back:
/*
!/fr*

Create the German lens the same way:

  1. Set Paths where this lens should be used to /de*.
  2. Enable the search surfaces that visitors use on German pages.
  3. In Pages to include or exclude, use:
/*
!/de*

The pattern is the important part: the lens applies to the language path being viewed, and it only returns pages from that same language path.

Include the whole language section

Use /fr*, not /fr, for the French lens. The * makes the lens apply to the whole translated section, including pages such as /fr/a-propos, /fr/prestations, and /fr/blog/article-exemple.

Use the same pattern in the include rule:

/*
!/fr*

This keeps the lens from returning the default-language version of the same page.

Test before launch

After creating your lenses, use the lens tester on the Search Lenses overview page.

Check at least one URL per language:

/about
/fr/a-propos
/de/ueber-uns

For each URL, confirm that:

  • the selected lens matches the page language
  • a query for translated page text returns results in that language
  • the same query does not return duplicate results from other language paths
  • both Search inputs and Search overlay behave correctly if both are enabled

Keep the setup simple

For most sites, the best multilingual Monocle and Weglot setup is:

  • Weglot subdirectories for server-rendered translated pages.
  • One Monocle index for the root domain.
  • One search lens per language path.
  • A fresh crawl after translation changes.

If you add a new language later, repeat the same lens setup for the new path and update the Default lens to exclude it.