Skip to content
FunnelGuard

Fix guide by FunnelsGuard

hreflang in both sitemap and head with conflicts: how to fix

SEO-271Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

hreflang is an annotation that links the language and region versions of a page, for example en-us, en-gb and de-de. You can declare it in three places: <link> tags in the HTML <head>, the HTTP header (useful for PDFs), or an XML sitemap.

Using more than one method is allowed. The problem starts when they disagree: different URLs, different language codes, a page listed in one but missing from the other, or a trailing slash or http versus https mismatch. This often happens when an SEO plugin writes head tags and a separate sitemap tool or translation plugin writes the sitemap.

Why it costs you leads or sales

Conflicting hreflang can lead to the wrong country version appearing in search results. A visitor in the UK may land on a US page with dollar prices, or a German visitor on an English page. They are more likely to leave, and the form or checkout they meet may not match their market.

The impact is usually low and gradual. Search engines treat hreflang as a hint, so they often work out a sensible answer anyway. But on multi-market sites, unclear signals make the wrong version ranking harder to diagnose.

How conflicting signals reach the visitor
  1. Head tagsLists en-gb and en-us
  2. SitemapLists en-gb, en-us and de-de with different URLs
  3. Search engineCannot trust either set fully
  4. Wrong version shownVisitor lands on the wrong market page

The break happens when the head and sitemap list different alternates.

How to check if your site has it

Compare the head and the sitemap
  1. Pick a sample page

    Choose a page that exists in every language, such as the home page or a pricing page.

  2. Read the head tags

    Open the page, view source and search for hreflang. Note each language code and URL.

  3. Read the sitemap entry

    Open your sitemap (often /sitemap.xml or /sitemap_index.xml) and find the same URL. Look for xhtml:link lines with rel="alternate".

  4. Compare line by line

    Check that both lists have the same languages, the same exact URLs (protocol, www, trailing slash) and the same codes.

  5. Crawl at scale

    Run a crawler such as Screaming Frog or Sitebulb with hreflang crawling enabled for both HTML and sitemap, then open its hreflang reports for inconsistencies.

Example of hreflang in the headhtml
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Example of the same page in an XML sitemaphtml
<url>
  <loc>https://example.com/uk/</loc>
  <xhtml:link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
  <xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>

How to fix it

The simplest fix is to keep one method and switch the other off. Head tags suit smaller sites and are easy to inspect. Sitemaps suit large sites where adding tags to every page is heavy. Whichever you choose, every version must list all versions, including itself, and each must link back.

Keep one source of hreflang
  1. Find who writes hreflang

    Check your multilingual plugin (for example WPML, Polylang, TranslatePress) and your SEO plugin. More than one may output hreflang.

  2. Disable the duplicate output

    Turn off hreflang in the SEO plugin's settings or sitemap settings if the multilingual plugin already handles it, or the other way round. Settings names vary by plugin.

  3. Regenerate the sitemap

    Clear caches and re-open the sitemap to confirm the old entries are gone.

Two conflicting sources vs one clean source

Before

  • Head lists en-gb and en-us
  • Sitemap lists en-gb, en-us and de-de
  • Some URLs differ by trailing slash
  • Two plugins writing hreflang

After

  • One method outputs all versions
  • Every page lists itself and every alternate
  • URLs match the canonical URLs exactly
  • Other method switched off

How to confirm it's fixed

Confirmation checklist
  • View source on a sample page: hreflang appears only if you chose the head method
  • The sitemap has no xhtml:link lines if you chose the head method (or the reverse)
  • Each version lists itself and all others
  • Every alternate links back to the page
  • URLs match the canonical URLs exactly
  • A fresh crawl shows no hreflang inconsistency warnings
  • Google Search Console shows no new international targeting errors after recrawl

How to prevent it happening again

Prevention habits
  • Document which tool owns hreflang for the site
  • Re-check after installing or updating SEO or translation plugins
  • Re-check after a migration, new language launch or URL structure change
  • Schedule a periodic crawl that compares head and sitemap hreflang
  • Avoid hand-written tags in theme files when a plugin already handles them

How FunnelGuard handles this

FunnelGuard does not check this yet. Comparing hreflang in the head and the sitemap is a possible future check, but today it is not part of the service.

What FunnelGuard does do is run your real customer journeys, such as lead forms, checkouts and booking buttons, on a schedule, and check each step, the tracking hits and whether test leads arrive. That helps you notice when a market's funnel breaks, but it will not tell you that hreflang signals conflict.

To watch for hreflang conflicts, run a crawler with hreflang reports on a schedule (for example monthly), and review the International Targeting and Pages reports in Google Search Console. A free read-only website audit from FunnelGuard is also available, though it is not an hreflang check.

Frequently asked questions

Questions people ask

Can I use hreflang in both the sitemap and the head?

Yes, Google treats the methods as equivalent and allows more than one. It only becomes a problem when the two lists differ. If you use both, they must match exactly, so most sites are better off keeping one.

Which is better for hreflang, the sitemap or the head?

Neither ranks better. Head tags are easy to inspect and suit small sites, while sitemaps suit large sites with many pages and languages. Choose the one your platform generates automatically.

What happens if my hreflang tags and sitemap conflict?

Search engines may ignore some annotations or pick one source over the other. Hreflang is a hint rather than a command, so the result is often the wrong country version appearing for some users.

How do I check if my hreflang sitemap matches my head tags?

Pick a page, view its source and note the hreflang links, then find the same URL in your sitemap and compare the alternates. For many pages, crawl the site with a tool that reads both HTML and sitemap hreflang and review its inconsistency reports.

Why does my WordPress site output hreflang twice?

Usually a multilingual plugin and an SEO plugin both add it. Check each plugin's settings, switch off hreflang in one, then clear caches and view the page source again.

Does hreflang need to include the page itself?

Yes. Each version should list itself as well as all its alternates, and every alternate should link back. Missing self-references or return links are a separate common error.

Does FunnelGuard check hreflang conflicts?

Not yet. It is a possible future check. For now, use a crawler and Google Search Console to watch for conflicts.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.