Skip to main content
Premium Tool

URL Variant Mapper

Import a CSV of page variants across locales, validate every URL relationship, and export production-ready hreflang tag bundles for your entire site.

Loading tool…

This page explains what the URL Variant Mapper does, how to import page variants for bulk validation and hreflang generation, the step-by-step workflow, import errors that cause invalid hreflang sets, and how this mapper differs from a general hreflang tag generator.

What is a URL variant mapper?

A URL variant mapper is a hreflang tool designed for importing and validating large sets of page variants. You supply a structured data file — CSV, TSV, or JSON — containing your pages and their locale-specific URLs, and the tool parses, validates, and generates hreflang annotations for every entry in the import.

This workflow is built for teams that already maintain a URL mapping in a spreadsheet, a database export, or a CMS report. Instead of re-entering data into a hreflang generator, you export your existing mapping and import it directly. The tool validates every entry against hreflang requirements (reciprocity, self-reference, ISO code validity, HTTPS, trailing-slash consistency) and generates output for the entire import in one pass.

The URL variant mapper handles imports with thousands of rows efficiently, processing data off the main thread to keep the interface responsive. Output formats include HTML <link> tags, HTTP Link: headers, XML sitemap xhtml:link elements, and JSON-LD.

How to use the URL variant mapper

Follow this import-and-validate workflow:

  1. Prepare your data file. Structure your CSV, TSV, or JSON with columns for page identifier, locale code, and URL. The locale code must be a valid ISO 639-1 language code optionally followed by a hyphen and an ISO 3166-1 alpha-2 region code (for example, en, es-MX, de-AT). URLs must be absolute and use HTTPS.
  2. Import the file. Upload or paste the file contents. The tool auto-detects the format (CSV, TSV, or JSON) and parses the data. A parsing summary shows the total rows, valid rows, and rows with issues.
  3. Review validation results. The tool runs a comprehensive validation pass: ISO code validity, URL format, duplicate locales within the same page group, missing self-references, and reciprocity. Issues are displayed in a filterable list grouped by severity (errors vs. warnings).
  4. Fix issues in the editor. Click any issue to jump to the affected row in an inline table editor. Correct the data directly — update a locale code, fix a URL, or remove a duplicate row. The tool re-validates in real time as you edit.
  5. Generate and export. Once all errors are resolved, generate the hreflang output for every page group in the import. Download the complete output as an XML sitemap, a ZIP of HTML snippets, or a bulk HTTP header configuration.

Common errors and how to fix them

Importing existing data surfaces errors that were invisible in the source spreadsheet:

  1. Malformed locale codes from spreadsheet formatting. If your spreadsheet auto-formats pt-BR as a date or en-IN as text with different casing, the imported locale code may be invalid. The tool shows the raw imported value next to the expected format so you can identify formatting artifacts.

  2. Relative URLs instead of absolute URLs. Spreadsheet exports often contain relative paths (/en/about) rather than absolute URLs (https://example.com/en/about). The tool detects relative URLs and offers a bulk-fix option: specify a base domain, and every relative path is prefixed to form an absolute URL.

  3. Duplicate page-locale pairs. If your spreadsheet has two rows for the same page with the same locale code but different URLs, the hreflang set has a conflict. The tool highlights duplicates and lets you choose which URL to keep or merge the entries.

  4. Missing page groups. If your import covers pages A through Z for English and Spanish but only A through M for German, the German entries for pages N through Z are missing. The tool compares locale coverage across page groups and flags asymmetric sets.

  5. Encoding issues in non-ASCII URLs. CSV files saved with incorrect encoding may corrupt non-ASCII characters in URLs (for example, Japanese or Arabic path segments). The tool detects encoding issues by checking for common corruption patterns (replacement characters, double-encoding) and warns before processing.

How this tool is different

The URL variant mapper is purpose-built for the import-validate-generate pipeline:

For entering hreflang data manually rather than importing it, use the hreflang tag generator. For auto-discovering URL relationships from a flat list, see the alternate mapping generator.

Frequently asked questions

  • What is a URL variant mapper?
    A URL variant mapper reads a spreadsheet listing every locale variant of every page on your site, validates the relationships, and outputs correct hreflang tag sets.
  • How is this different from a URL alternate mapper?
    The variant mapper focuses on site-wide bulk operations — mapping hundreds or thousands of page variants at once — while the alternate mapper works per-page.
  • What validation does the mapper perform?
    It checks URL syntax, reciprocal consistency, duplicate detection, missing self-references, and locale code formatting across every row in your CSV.
  • Can I map variants across subdomains and subdirectories?
    Yes. The mapper is structure-agnostic: each row can mix subdomain URLs, subdirectory URLs, and even different TLDs for the same page group.
  • What does a production-ready hreflang bundle include?
    It includes HTML link tags, HTTP header syntax, and XML sitemap entries — all validated for reciprocity and ready to paste into your deployment pipeline.
  • How does the mapper handle large CSV files?
    It processes the file in a background thread so the UI remains interactive. Progress is shown in real time with a row counter and error summary.
  • Can I filter the output by locale or page group?
    Yes. After import, use the filter sidebar to narrow results to specific locales, URL patterns, or validation status before exporting.
  • Does the mapper support region-specific variants like en-US and en-GB?
    Yes. Use full BCP 47 locale codes in your CSV headers to distinguish regional variants. The mapper treats each code as a separate variant.
  • What if I need to add a new locale later?
    Add a new column to your CSV, fill in the new URLs, and re-import. The mapper regenerates all hreflang sets including the new locale.
  • Can I share the validated mapping with my team?
    Yes. Export the full validated mapping as a CSV or JSON file that your teammates can review, edit, and re-import at any time.

Related tools