quialo.

How to Add Hreflang to a Whole Site

2026-10-15

Add hreflang to every page from a CSV or a URL pattern, then check return links before you publish.

Hreflang is how you tell search engines which URL belongs to which language or region. One page is easy: a few link tags in the head. A whole site is a different job, because every URL has to point at its alternates, and every alternate has to point back. Quialo's hreflang generator builds that file in your browser from a CSV or a URL pattern, then checks the result before you publish.

What you are actually publishing

Each version of a page lists the full set of versions, including itself. The English pricing page points at the German pricing page, the British English pricing page, and its own URL. The German page lists the same set. If one side is missing, search engines may ignore the pair.

You can publish that list in three places. HTML link tags go in the head of each page. An XML sitemap lists every page in one file, which is the practical choice once you have more than a handful of URLs. An HTTP Link header is for files that have no head, such as PDFs. Use one method. If the tags and the sitemap disagree, you have given search engines two answers.

A CSV for pages that do not share a pattern

When the URLs are irregular, a spreadsheet is the clearest source. The first row is language codes. Each row under that is one page, with a URL in each column:

en,en-GB,de,x-default
https://example.com/,https://example.com/uk/,https://example.com/de/,https://example.com/
https://example.com/pricing,https://example.com/uk/pricing,https://example.com/de/pricing,https://example.com/pricing

Leave a cell blank when that page has no URL for a language. Quote a cell if the URL itself contains a comma. The generator reads the file on your device. It is not uploaded.

x-default is the fallback for visitors whose language is not in the list. It often shares the URL of your main language, which is why the English home page and x-default can be the same address. The sitemap then has one url entry for that address, with two link elements.

A URL pattern when the paths repeat

If every language lives under its own folder, you do not need a column per URL. A pattern such as https://example.com/{lang}/{path}, the codes en, de, and a list of paths (/, pricing, about) expands into the same kind of sets. Choose which code x-default should reuse so you do not invent a folder named x-default.

Codes follow ISO rules. en-GB is the United Kingdom. en-UK is ignored, because UK is not a region code. A bare uk means Ukrainian.

Return links and the 50,000 URL cap

After the sitemap is built, every url entry should list every alternate in its row, including its own loc. Download the XML, or download a zip of HTML snippets if you still want tags in each head.

A sitemap file can hold 50,000 URLs, or 50 MB, whichever comes first. Past that, the generator splits the file and names the parts. Submit each part, or list them in a sitemap index.

Before you ship the file, paste it into the checker on the same page. It reports a missing return link (the German page never points back), a page that does not list itself, a code used twice, a bad code such as en-UK or en_US, two URLs fighting over the same code, and a set with no x-default. It only reads what you paste. It does not fetch your live site, so the pages you want checked have to be in the paste.

Explore related tools in the tools directory.

More guides