By SitemapFixer Team
Updated October 2026

Sitemap “Invalid URL” and “URL Not Allowed”: How to Fix Them

Find your sitemap and test 30 of its URLsCheck My Sitemap

Short answer: every URL in a sitemap must be a complete, valid address (with https:// and the host) on the same host and protocol as the sitemap, and at or below the sitemap’s folder. “Invalid URL” means a URL in the file isn’t valid. “URL not allowed” means a URL is valid but sits on another domain or above the sitemap’s folder. Put the sitemap at your site root, list only full URLs on that exact host, and resubmit.

The URL errors Search Console reports

From Google’s Sitemaps report help, under Indexing → Sitemaps → your sitemap:

Invalid URL

“A URL in your sitemap is not valid.” Typical causes: a relative path (/page), a missing protocol (example.com/page), spaces or unencoded characters, or a stray character from a template.

URL not allowed

“Your sitemap includes some URLs that are at a higher level or different domain.” A sitemap at https://example.com/blog/sitemap.xml can only list URLs under /blog/. A sitemap on one host can’t list another host’s pages.

Invalid URL in sitemap index file: incomplete URL

Your sitemap index lists a child sitemap without its full URL, such as /sitemap-posts.xml. Use https://example.com/sitemap-posts.xml.

Path mismatch: Missing www / Includes www

The sitemap’s path and the property or URLs disagree about www. If your site lives on www.example.com, the sitemap and every URL in it should too, and the other host should redirect.

The URL rules a sitemap must follow

  • Full URLs with protocol and host. Google crawls them exactly as written.
  • Same protocol and host as the sitemap file. http:// URLs in an https:// sitemap, or example.com URLs in a www.example.com sitemap, break this rule. See HTTP URLs in an HTTPS sitemap.
  • At or below the sitemap’s folder. Put the sitemap at the root, and it can cover the whole site.
  • Under 2,048 characters, escaped for XML (& as &) and percent-encoded for spaces and non-ASCII characters. See sitemap encoding errors.
<!-- sitemap at https://www.example.com/sitemap.xml -->
<loc>/pricing</loc>                              <!-- invalid: relative -->
<loc>www.example.com/pricing</loc>               <!-- invalid: no protocol -->
<loc>https://example.com/pricing</loc>           <!-- not allowed: other host -->
<loc>https://www.example.com/pricing</loc>       <!-- correct -->

Need one sitemap for several sites?

The protocol allows it only if you prove you control each host. The usual way is a Sitemap: line in the robots.txt of every host whose URLs the file lists, pointing to the shared sitemap. Search Console also accepts a sitemap for another property you have verified. For most sites, one sitemap per host is simpler.

Find and fix the bad URLs

curl -s https://www.example.com/sitemap.xml | grep -o '<loc>[^<]*' | sed 's/<loc>//' \
  | grep -v '^https://www\.example\.com/'   # anything not on the exact host

Then fix the generator, not the output: set the site URL correctly in your CMS or framework (a wrong “site URL” setting is the usual cause of wrong-host URLs after a move), and resubmit the sitemap. The free sitemap checker flags inconsistent URL patterns and tests 30 URLs live.

Frequently asked questions

What does "URL not allowed" mean in a sitemap?

Your sitemap lists URLs at a higher level or on a different domain than the sitemap itself. For example, a sitemap in /blog/ listing /shop/ pages, or a sitemap on www.example.com listing example.com URLs.

Can one sitemap list URLs from several domains?

Not by default. All URLs must use the same host and protocol as the sitemap. Cross-site sitemaps are possible only when you prove ownership, for example by referencing the sitemap in the target site’s robots.txt.

Are relative URLs allowed in a sitemap?

No. Every <loc> must be a full URL with https:// and the host, such as https://example.com/page. A sitemap index also needs full URLs for each child sitemap.

How long can a sitemap URL be?

Under 2,048 characters, per the sitemaps.org protocol.

Check the URLs in your sitemap
Free - reads your sitemap and tests 30 URLs live
Check My Sitemap Free

Related guides