Meta-Scan

AI-Friendly AEO & GEO & SEO Analyzer

Blog
WARNING
Support
© 2026 Meta-Scan. All rights reserved.
BlogAboutPrivacy PolicyTerms of Service
SYSTEM WARNING
Home/Blog

How to Create and Submit a sitemap.xml

Yuuuk94·Published 2026-11-12

Summary

sitemap.xml is an XML file that tells search engines "these are the URLs on my site". Google can find pages by following links without one, but new sites with few external links and large sites get discovered more slowly.

What matters more than having the file is what goes in it. List only the canonical URLs you want in search results; leave out noindex pages, redirecting URLs and duplicates.

01Basic format

Sitemaps follow the protocol defined at sitemaps.org. The simplest form is a <url> with a single <loc>. <lastmod> (last modified date) is optional but helps when it is accurate.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourdomain.com/</loc>
    <lastmod>2026-11-01</lastmod>
  </url>
  <url>
    <loc>https://yourdomain.com/blog/first-post</loc>
    <lastmod>2026-11-10</lastmod>
  </url>
</urlset>
TagRequiredDoes Google use it?
locYesYes. Must be a full URL starting with https://
lastmodNoYes, if it is consistently accurate
changefreqNoIgnored
priorityNoIgnored

Many generators add changefreq and priority by default, but Google says it ignores them. They don't hurt, but don't spend time on them. On the other hand, stamping every page's lastmod with the build time destroys trust in it; use the date the content actually changed.

02What to include and what to leave out

A sitemap is a list that says "please index these URLs". Mixing in URLs you don't want indexed sends conflicting signals, which is why Search Console shows warnings like "Submitted URL marked 'noindex'".

IncludeLeave out
Home, key feature pages, blog postsPages with noindex
Canonical URLs that point to themselvesURLs that redirect elsewhere
Each language's canonical URL on multilingual sitesSearch, filter and sort parameter URLs
Pages viewable without logging inLogin, account and checkout pages

Real example

META_SCAN's sitemap originally included the scan progress and result screens. Those are tool screens that only mean something once a URL is entered, so on their own they have almost no content. They now carry noindex and are out of the sitemap.

03Size limits and sitemap index files

A single sitemap can hold up to 50,000 URLs and 50 MB uncompressed. Beyond that, split it into several files and create a sitemap index that lists them; then submit just the index URL.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://yourdomain.com/sitemap-pages.xml</loc>
  </sitemap>
  <sitemap>
    <loc>https://yourdomain.com/sitemap-blog.xml</loc>
  </sitemap>
</sitemapindex>

Even on smaller sites, splitting by type lets you see per-group status in Search Console, for example how many blog posts are indexed.

04Generating it in common frameworks

Maintaining a sitemap by hand means forgetting to add new pages. Most frameworks can generate it at build or request time.

SetupHow
Next.js (App Router)Return an array of URLs from app/sitemap.ts and it is served at /sitemap.xml. You can read your posts to set lastModified.
WordPressCore provides /wp-sitemap.xml since 5.5; SEO plugins replace it with their own.
Static site generatorsGatsby, Astro, Hugo and others have official plugins or built-in support.
Custom serverAdd one route that reads public pages from your database and returns XML.

05How to submit it

  1. Reference it in robots.txt: add Sitemap: https://yourdomain.com/sitemap.xml at the bottom. Google and Bing both read it.
  2. Google Search Console: enter the sitemap URL under Indexing > Sitemaps. Processing status and discovered URL counts appear there.
  3. Bing Webmaster Tools: submit it there too, or import your Search Console property. Bing's index also feeds some AI search products.

Google used to accept sitemap pings at google.com/ping?sitemap=..., but it retired that endpoint in 2023. Today the supported routes are robots.txt, Search Console submission and an accurate lastmod.

06What to check after submitting

  • The status in Search Console's Sitemaps screen is "Success". "Couldn't fetch" usually means a 404 or a robots.txt block.
  • The discovered page count is close to the number of URLs you listed.
  • In Indexing > Pages, filtered by sitemap, why unindexed URLs aren't indexed.
  • No URLs in the sitemap use http, another domain, or a development address.

Submitting a sitemap doesn't mean every URL gets indexed. It helps discovery; indexing depends on quality and duplication. For a step-by-step diagnosis see site not showing up on Google.

FAQ

Q. Does a small 10-page site need a sitemap?
Not strictly. Google finds a small, well-linked site on its own. But a sitemap costs almost nothing and makes indexing status easier to follow in Search Console, so it is worth having.
Q. Do I need to resubmit after updating the sitemap?
Not if the URL is the same; Google rereads submitted sitemaps periodically. If it is urgent, submit the same URL again in Search Console.
Q. Can I include images and videos?
Yes, there are image, video and news extensions. For a typical service site, accurate page URLs are enough.

Related reading

  • Site Not Showing Up on Google? 7 Things to Check
  • How to Check robots.txt and 5 Common Mistakes
  • How to Check for an Accidental noindex

References

  • sitemaps.org: Sitemaps XML format
  • Google Search Central: Build and submit a sitemap
  • Google Search Central: Manage your sitemaps with sitemap index files
  • Google Search Central Blog: Sitemaps ping endpoint is going away
  • Bing Webmaster Tools

Author

Yuuuk94

Frontend developer who grew a product's MAU by 350% using SEO and Lighthouse as the yardstick, then turned that checklist into META_SCAN.

More about me →

How does your site do?

Enter one URL to run the free SEO/AEO/GEO checklist, including everything covered in this post.

Check for free