See llms.txt for all machine-readable content.

Back to Templates

Check hreflang return links from XML sitemaps with web forms and HTTP

Quick overview

Paste a sitemap URL into a form and get a hreflang report for your multilingual site. The workflow checks return links, self-references, duplicate languages, language codes and relative URLs, then shows the errors on the form’s finish page. No credentials, no AI, no setup.

How it works

  1. n n8n form asks for a sitemap URL and how many pages to check (1 to 500).
  2. The workflow fetches the sitemap. If it is a sitemap index (WordPress, Yoast, Rank Math), it fetches the child sitemaps as well.
  3. It collects the unique page URLs and keeps the first N.
  4. It fetches each page gently, 2 per second, with up to 3 retries.
  5. It reads every hreflang link tag in the page head and checks language codes, absolute URLs, self-references and duplicate languages.
  6. It checks that each alternate page links back to the source page, as long as that alternate was among the checked pages.
  7. The finish page shows the errors as a table, a missing x-default as a recommendation, and pages that could not be fetched as a separate list.

Setup

  1. Import the workflow. No credentials are needed.
  2. Activate it, or click Test workflow, and open the form URL.
  3. Paste a publicly reachable XML sitemap URL and choose how many pages to check.
  4. If your site blocks automated requests, allow the User-Agent “n8n hreflang checker (template)” or lower the batch size in Fetch Page Content.

Requirements

  • A publicly reachable XML sitemap (single sitemap or sitemap index)
  • Hreflang tags in the HTML head of your pages

Customization

  • Change the batch size and interval in Fetch Page Content to check faster or more gently.
  • Raise the 500-page cap in Collect Sitemap Page URLs for larger sites.
  • Add a Google Sheets or Data table node after Extract Hreflang Tags to track fixes over time.

Additional info

Limitations: the workflow checks hreflang in the page head only, not in XML sitemaps, HTTP headers or tags added by JavaScript. Return links can only be verified for alternates among the checked pages. The result says how many were outside the check.