Cross-border site operators often struggle to ensure search engines correctly identify which language version of a page should be shown to specific users. This article addresses the practical configuration of hreflang annotations by clarifying the underlying HTML attributes and standardizing language tag formats. We will examine the structural requirements for link elements and the best practices for specifying language values, helping operators avoid common misconfigurations that lead to poor regional visibility.

Understanding the Role of hreflang in Multilingual Site Structure

This is a hypothetical situation, not a recommendation list. A cross-border seller planning a site with English, German, and Japanese versions starts with a simple multilingual directory and a mapping sheet the team can actually maintain.

The first worksheet is a page inventory, with one row per logical page and columns for page ID, English path, German path, Japanese path, language code, and region code. Two invented records show how it is used: record P-101 lists the homepage as English at /en/, German at /de/, and Japanese at /ja/, with language codes en, de, and ja and region codes left blank; record P-204 lists a product page as /en/product/desk-lamp/, /de/produkt/schreibtischlampe/, and /ja/product/desk-lamp/, with language codes en, de, and ja and region codes gb, de, and jp. The blank region cells in the homepage row are a deliberate choice: the seller wants the homepage to declare language only, because a region variant of a generic homepage would falsely imply a country-specific offer.

The second sheet holds candidate page titles, kept short for navigation and search result display. For the product page the author writes three working titles: “Modular Desk Lamp,” “Modulare Schreibtischlampe,” and “モジュラーデスクランプ.” A fourth candidate, “Desk Lamp EU Plug,” is set aside because the plug type is not confirmed for every market, so the title would overpromise. This is the author's own naming choice, not a claim about how search engines or registration pages will treat the text.

The third item is a link checklist that fixes each link's destination and channel before any markup is written. One row pairs the German product page with its English counterpart through an on-page link and its Japanese counterpart through the language switcher in the top navigation. Another row carries a self-referencing entry for the English page, reachable through the same switcher. Writing the destination and channel per row prevents the team from pointing two links at the same page and calling them alternates.

Finally the author keeps a change log with a column for the date a path changed and the page ID affected, so that a moved page is re-entered in the map before the new path appears in the switcher. These examples explain the problem only; the next sections describe how readers prepare their own inventory and checks.

Defining the hreflang Attribute Within Anchor Elements

In the a element, hreflang is listed among the element-specific attributes, alongside href, target, ping, rel, media and type. The specification says rel, media, hreflang and type may indicate the likely nature of the target resource before the user follows the link, so the attribute's stated role concerns the link's destination.1

The same element's requirements tie hreflang to href: target, ping, rel, media, hreflang and type must be omitted if the href attribute is not present. An a element without href is only a placeholder for where a link might have been placed. The DOM interface exposes hreflang as a string attribute.1

For this part, you can work from the same worksheet and turn each language-version row into a link-level note that names the destination and the language it represents. The next writing task is to draft, for one familiar page, the link text and the hreflang value that would sit on it, then read the pair aloud to check whether a visitor would understand where the link leads before clicking. A hypothetical example: for the German version of a product page, the author drafts link text “Produktseite auf Deutsch” with hreflang “de,” and for the English version “Product page in English” with hreflang “en.” You might prefer shorter link text, such as “Deutsch” and “English,” and note beside each choice whether it stays clear when read out of context. There is no single right answer here; the point is to record your preference and the reason so a colleague editing later can follow it. If a path in your inventory changes, revisit only the rows that point to it and update the link text and hreflang value together, then mark the date in your change log.

Selecting Valid Language Tags Using BCP 47 Standards

In the W3C Working Draft "Internationalization Best Practices: Specifying Language in XHTML & HTML Content," the section on choosing language values directs authors to select values using BCP 47. It also covers deciding on language tag length and using Hans and Hant codes. This material appears under the document's language-values section, alongside the separate advice on declaring the language of a link destination.2

The same draft distinguishes the language of the intended audience from the text-processing language. For a site with parallel language versions, it notes that a document containing the same or parallel content in more than one language can have two audience languages. This wording keeps the case conditional rather than treating every multilingual page as having multiple audience languages.2

Take the language code column in your worksheet and replace each provisional label with a tag you can justify from the BCP 47 registry. For an English page aimed at a general audience, you can record en; for a German page aimed at Germany, de-DE; for a Japanese page aimed at Japan, ja-JP. If the same German content also serves Austria, consider whether a separate de-AT row is needed or whether one German row covers both—record whichever choice you make in a notes column beside the code. Avoid inventing subtags: if you are unsure whether a regional or script subtag applies, leave it out and keep the simpler tag.

Then check each row's tag against the version it describes. A page that mixes English navigation with German body text needs a decision: either split it into two tagged rows or give it the tag of the dominant content and note the mixture. You might add a short column for the reason behind each tag, such as "primary audience Germany" or "inherited from parent directory," so a later editor can see why the value was chosen rather than guessing. Once the tags are settled, update the map entries so each language path points to a row with a matching, defensible code.

A document can contain more than one audience language, and the W3C draft notes that metadata describing the language of the intended audience is about the document as a whole rather than every language appearing in it. A German city guide containing Chinese phrases remains aimed at German speakers, while a page presenting the same content in French and English is targeted at both audiences.2

For text-processing purposes, the draft treats the language of a specific range of text as a single value. Prose written in one language inside another can be marked with an attribute on the containing element, and included elements inherit the declared value unless overridden. Link destination language is not the same question as the page's declared language.2

You can start with one specific line from your page inventory: the German product page whose visible text is German but whose saved title remains English. Before annotating anything, mark that row with two separate columns, one for the language of the page content and one for the language of the linked destination. Filling both fields shows whether the German page points to a German page or to an English one, and that distinction changes how you label the link rather than the page.

If the row shows an English title above German body text, consider deciding first whether that page stays mixed or is split into two versions, since the language tag should follow the content a visitor actually reads. You might note the choice in a short remark column with a plain phrase such as "German body, English navigation, kept together for now." That note lets a later editor revisit the same row without rebuilding the inventory.

Implementing Metadata Declarations for Audience Intent

The page metadata for the intended audience is separate from the text-processing language. The W3C draft says this audience metadata concerns the document as a whole and may serve searching, serving the right language version, and classification. It is usually best declared outside the document in the HTTP Content-Language header, though an internal declaration using the meta element may suit some situations.2

Both the Content-Language meta element and the HTTP header allow a list of values. The draft's example declares German, French, and Italian as the intended audience's languages in equal measure. It also notes a document aimed at a multilingual community may have two audience languages, or mixed articles.2

For one concrete row in your inventory, the German product page with an English saved title, you can add a short intent note beside the language code rather than starting new markup. Write what each language version is for: the German page serves buyers searching in German for a localised product description, while the English page serves comparison shoppers. This note gives the later hreflang row a reason, not just a code.

You might then test the pair against your title candidates. If the German body text addresses German-speaking buyers but the title stays English, consider whether the title is deliberate brand text or leftover copy; if it is leftover, revise it, and if it is deliberate, record that choice so the declaration matches the intended audience.

Keep the note short enough that a colleague can read it in one pass, and add a date when the intent changes. The declaration then flows from a stated audience purpose rather than from guessing.

Verifying Annotation Consistency Across Page Variants

You can take the same three-language worksheet you already have and add a verification pass before any annotation is written, using the German product page as your working example. Start by opening the page inventory and reading each row aloud as a single question: does this row describe one page, one language, and one destination? For the German product page row, you might note that the path says German, the language code says German, and the visible title still says English. That mismatch is the kind of thing this pass is meant to catch, and catching it in the sheet is cheaper than catching it after the markup is applied.

Once a row reads consistently, you can check it against its siblings in the same logical page group. The English and Japanese rows for that same product page should each carry their own language code and their own path, and none of them should point at the German path by accident. A simple way to do this is to cover the path column with your hand and predict what each row's path should be from the page ID and language code; if your prediction differs from what is written, the row deserves a second look. This is an author's check on paper, not a claim about how any search engine behaves.

You might also keep a short note column for rows that are deliberately mixed, such as a page whose body is German but whose saved title was left in English pending a rewrite. Marking that intent explicitly stops a later reader from "fixing" the language code to match the title, and it gives the team a reason to revisit the row when the title is rewritten.

Consider setting a review rhythm rather than a one-time sweep: whenever a path changes, a title is rewritten, or a new language version is added, the affected rows go back through the same read-aloud check. You can record the review date in the change log you already keep, so the verification pass leaves a trace without becoming a separate document.

Frequently asked questions

How do you keep candidate page titles short for navigation and search results?

The second sheet holds candidate page titles, kept short for navigation and search result display. For the product page the author writes three working titles: “Modular Desk Lamp,” “Modulare Schreibtischlampe,” and “モジュラーデスクランプ.”

How can you start with one specific line from your page inventory before annotating anything?

You can start with one specific line from your page inventory: the German product page whose visible text is German but whose saved title remains English. Before annotating anything, mark that row with two separate columns, one for the language of the page content and one for the language of the linked destination.

How do you keep track of rows that are deliberately mixed?

You might also keep a short note column for rows that are deliberately mixed, such as a page whose body is German but whose saved title was left in English pending a rewrite.