Document hreflang generation by recording the locale-to-URL inventory, the exact generated HTML block, its installation point, and the evidence that every alternate page carries the same reciprocal set.

A useful record is more than a saved copy of the tags. It should let another person reproduce the output, understand why each locale was included, locate the deployed markup, and confirm that the live pages still agree with the approved source.

how do i document the steps i use to generate hreflang
How Do I Document the Steps I Use to Generate Hreflang?

What a useful hreflang record contains

Break the record into stages. This separates decisions about the language cluster from the generated code, the publishing action, and the verification results. It also makes incomplete implementations easier to identify.

Stage What to document Acceptance evidence
Scope Language cluster, owner, date, target pages, and chosen implementation method A named set of substantially equivalent localized pages
Input Every locale | fully qualified URL row, including the current page Between 2 and 100 rows, one separator per row, and no duplicate locale
Generation The source rows and unmodified generated HTML One escaped rel=alternate element per row with canonical locale casing
Deployment Template or CMS location, deployment date, and pages covered The identical complete set in every alternate page head
Verification Crawl results for the deployed pages Matching sets, self and return links, and useful 200 pages

Keep the source inventory, generated output, deployment record, and crawl evidence together. Also retain the reason for each decision that cannot be inferred from a URL, such as why a regional page exists or why x-default points to a particular fallback.

Prepare the locale-and-URL source

Start with one row for every localized page in the language cluster. Each row must use the exact format locale | fully qualified URL. Include the page currently being edited, not only its alternates, because each localized version must publish the same complete set and link to itself.

  • Use absolute HTTP or HTTPS URLs that include the host. Relative and scheme-relative URLs are rejected.
  • Do not include credentials or fragments in a row. The browser URL parser normalizes submitted addresses, so retain both the original row and the generated result.
  • Put the language first. A two-letter language is accepted, followed by an optional four-letter script and optional two-letter region, such as en, en-US, zh-Hans, zh-Hant, or fr-CA. A country code cannot stand alone.
  • Remove duplicate locale values. Duplicate checks apply case-insensitively after locale normalization.
  • Include one x-default row only when a genuine fallback exists. It is a fallback selector, not a language code, and it should not be added merely to complete a list.

Locale case is canonicalized in the output, so en-us becomes en-US and zh-hant becomes zh-Hant. Document that normalization rather than rewriting history in the source sheet. A source row records what the team approved; the generated block records the exact code that was reviewed and deployed.

The generator checks language-tag shape rather than the complete current language and country registries used by a search engine. Compare every intended tag with Google’s localized versions guidance and the actual language audience before publication.

Document the generation and deployment workflow

  1. Create a record header. Write down the cluster name, responsible owner, creation date, page being edited, chosen delivery method, and source of the locale assignments. This tells a reviewer what the set is meant to cover before examining any markup.
  2. Freeze the source rows. Save the locale-and-URL inventory in a durable file or issue. Include every alternate and the current page. Add x-default only when users with unmatched language or region settings have a useful fallback destination.
  3. Run the input checks. Confirm that the set contains at least two rows and no more than 100. Each line must contain exactly one vertical bar. Check that every URL is fully qualified, contains no credentials or fragment, and every locale is unique after normalization. Malformed input fails the entire set, preventing a partial block from being copied while a version is silently omitted.
  4. Generate and archive the block. Use Hreflang Generator to submit the exact rows and produce one escaped rel=alternate element per row. Save the generated HTML beside the source inventory and record the generation date. Attribute-sensitive characters are escaped, and locale casing is canonicalized, so the archived output should remain exactly as generated unless it is regenerated and reviewed again.
  5. Review targeting decisions. Confirm that each locale matches the page’s real content and intended audience. Decide separately whether a generic language page, script-specific page, regional page, or x-default fallback belongs in the cluster. The tool can validate its accepted tag structure, but it cannot prove that a language and region are appropriate for the content.
  6. Install the same set everywhere. Place the identical block in the HTML head of every localized page, including the current page. Record the template, CMS field, or publishing path used. This tool produces HTML head elements; do not combine inconsistent copies across HTML, HTTP headers, and XML sitemaps. Choose the method that your publishing system can keep complete and synchronized.
  7. Crawl and retain the evidence. After deployment, crawl the live pages and compare their sets mechanically. Confirm that each page includes the complete set, points to itself, points back to every alternate, and resolves to a useful 200 page. The generator cannot access remote pages or prove reciprocity, so this deployed check is a separate required record.
  8. Close the loop. Note any missing tags, redirects, broken alternates, or set differences in the documentation. When a locale is added, removed, redirected, moved, or assigned a new canonical URL, update the source inventory, regenerate the complete set, redeploy it to every member, and crawl again.

Record decisions the generator cannot verify

The generated elements describe relationships among equivalent localized pages; they do not translate the content. A locale | URL row can be structurally valid while the target page still has the wrong language, an unsuitable regional offer, or materially different information. Record the audience and content decision alongside the code.

  • Regional and script targeting: Use a regional tag when the audience and offer require it, such as fr-CA. Script subtags can distinguish writing systems such as zh-Hans and zh-Hant. A generic fr page may be a useful fallback when several country-specific French versions exist.
  • x-default purpose: Document the unmatched-user scenario, the fallback page’s purpose, and why it is better than the listed alternatives. Only one x-default row should appear in a set.
  • Equivalent content: Note how the localized pages maintain substantially equivalent content. Hreflang is not a substitute for translated primary content or a coherent international site architecture.
  • Search behavior: Do not promise that the tags will select a particular result. Hreflang does not detect language or guarantee a search result; search engines may use many other signals.

The output uses the HTML alternate-link relationship described by WHATWG’s alternate links guidance. In your documentation, distinguish the generated rel=alternate link element from the broader hreflang relationship it represents.

Keep deployed sets synchronized

Treat the approved row inventory as the source of truth and the deployed markup as a synchronized copy. When one URL changes, updating only the affected page leaves the cluster inconsistent. The same applies when a language version is removed or redirected: revise the complete set and install it in every remaining member.

Choose one implementation method that your system can maintain. Google treats HTML, HTTP headers, and XML sitemaps as equivalent methods, but maintaining different sets across them can create drift. Because the Hreflang Generator creates HTML head elements, its output should be documented as part of an HTML implementation rather than as a sitemap or header annotation.

After every approved change, crawl a sample from every language cluster and compare the deployed sets. A sample helps detect systematic mistakes, while the documented source rows and a complete comparison make omissions easier to investigate. Keep the new crawl result with the previous record so the change history shows what was altered and why.

Hand off a complete audit trail

Before marking the work complete, ask whether another reviewer could answer these questions from the saved record:

  • Which localized pages belong to the cluster?
  • What exact rows were submitted as generator input?
  • Which HTML block was generated, and where was it installed?
  • Which locale, script, region, and fallback decisions were made?
  • What crawl results confirmed self-links, return links, matching sets, and useful responses?
  • Which pages changed after deployment, and was the complete set regenerated?

Store the source rows and generated output together, then attach the deployment and crawl evidence. That combination documents the full path from approved locale inventory to live HTML, while preserving the generator’s important limits: it validates the accepted input structure, but it cannot translate content, confirm search-engine registry support, access remote pages, or prove reciprocal links.

If you're weighing options, How to Fix Hreflang That Looks Wrong After Generation covers this in detail.

If you're weighing options, How to Document Nginx Config Generator Steps covers this in detail.