An XML sitemap is a machine-readable document that lists every canonical URL you want search engines to crawl and index on your website. Instead of waiting for web crawlers to find pages purely through links, the file hands search engines an organized directory of your content along with helpful metadata like when each page last changed. It acts as an inventory checklist for search bots rather than a visual navigation menu for human visitors.

What does an XML sitemap do for search engines?

Search engines crawl the web by following links from one page to another. If your site has thousands of pages, poor internal linking, or fresh URLs published five minutes ago, crawlers can take weeks to discover them on their own. An XML sitemap gives search engine bots a direct feed of your pages so they do not have to stumble onto them by accident.

When you build a clean file with a tool like the Links to Wild Sitemap.xml Generator or an automated CMS plugin, you provide several standard data points for each address:

  • Location (<loc>): The absolute, canonical URL of the page.
  • Last modified date (<lastmod>): The timestamp showing when the content on that URL was last updated.
  • Change frequency (<changefreq>): A general hint about how often the page updates, such as weekly or monthly.
  • Priority (<priority>): A relative score between 0.0 and 1.0 showing how important the page is relative to other pages on your own site.

Google has stated publicly through Google documentation that its crawler pays close attention to <loc> and <lastmod>, while mostly ignoring <priority> and <changefreq>. Even so, the protocol standard supports all four tags, and keeping them structurally sound prevents validation errors across different crawlers.

When does an XML sitemap matter, and when does it not?

Every website can have a sitemap, but its practical impact varies depending on the scale and structure of your site.

On small websites with fewer than 500 pages and clean internal navigation, search bots can crawl every page in seconds simply by following links. If every page links from your header, footer, or blog archive, an XML sitemap adds very little to discovery. The crawler will find your pages anyway because nothing is hidden deep in an archive.

Even on small sites, submitting a sitemap is still recommended because of diagnostics. Google Search Console breaks down indexing coverage by sitemap. When you submit your URLs in a sitemap file, Search Console reports whether those specific URLs are indexed. That turns an ambiguous warning into an exact list of problem pages you can inspect.

An XML sitemap becomes essential when your site fits any of these situations:

  • Large websites: E-commerce stores or directory portals with tens of thousands of pages can exhaust a crawler's daily crawl capacity if bots waste time crawling dead ends.
  • New domains: Fresh sites have few external backlinks pointing to them, so search bots do not visit them often through third-party referrals.
  • Deep archives: Content buried four or five clicks away from the homepage often gets ignored unless it appears in a sitemap.
  • Rich media assets: Specialized image or video sitemaps help search engines parse media that is embedded with complex JavaScript.

A worked example of a sitemap.xml file

An XML sitemap must follow the strict formatting standards established by the sitemaps.org schema. It must be UTF-8 encoded, use absolute URLs including the protocol (https), and reside on the same host as the URLs it lists.

Here is an example showing how a basic two-page sitemap looks in raw code:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-01-15T09:30:00+00:00</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://example.com/services</loc>
    <lastmod>2026-02-01T14:15:00+00:00</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

A single sitemap file is limited to 50,000 URLs and an uncompressed size of 50 megabytes. If your site exceeds either limit, you split the list across multiple sitemap files and combine them inside a parent document called a sitemap index file.

Sitemap XML and robots.txt: how they work together

People often confuse sitemaps with robots.txt, but they perform opposite roles in your technical SEO setup. You can review our guide on how to create a sitemap for detailed creation steps, but understanding the boundary between the two files is critical.

A robots.txt file tells search engines where they are not allowed to go. It blocks crawlers from accessing admin directories, staging environments, or internal search result pages. An XML sitemap does the reverse: it tells search engines where you actively want them to go.

These two files connect through a single directive. At the bottom of your robots.txt file, you can state the public address of your sitemap:

Sitemap: https://example.com/sitemap.xml

When a crawler visits your site, it checks robots.txt first. By placing the sitemap URL there using a tool like our Robots.txt Generator, you inform every compliant bot about your page directory automatically, without needing to submit the file manually to every search engine.

Common mistakes that break sitemap value

A poorly maintained sitemap causes more problems than having no sitemap at all. Search engines stop trusting the file when its claims conflict with what their bots find on the live pages.

Watch out for these frequent implementation errors:

  1. Faking the lastmod tag: The <lastmod> date should represent the moment the page content meaningfully changed. If your CMS automatically stamps every URL with the current build time whenever a developer changes a footer link, Google will notice that thousands of pages claiming fresh content contain zero new text. Once a crawler detects that pattern, it stops trusting your lastmod values entirely.
  2. Including non-canonical URLs: Your sitemap must only contain 200-status, indexable, canonical URLs. Do not include URLs that redirect (301 or 302), URLs returning 404 errors, pages blocked by robots.txt, or pages bearing a noindex tag.
  3. Listing infinite faceted variations: Filtered product pages (such as a shoe catalog sorted by size, color, price, and brand simultaneously) create millions of low-value URLs. Only canonical category URLs belong in your sitemap.
  4. Exceeding namespace limits: Forgetting to close an XML tag or pasting unescaped ampersands in URLs (writing & instead of &amp;) invalidates the whole file. You can catch these syntax bugs before submitting by running your link list through an XML Sitemap Validator.

How to generate and submit your file

Creating and publishing your file can be done using built-in platform features or browser tools depending on your site setup.

If you use a modern content management system like WordPress, Shopify, or Webflow, the platform generates a sitemap automatically. In modern WordPress, a basic sitemap exists by default at /wp-sitemap.xml. Dedicated SEO plugins provide additional controls to toggle specific custom post types on or off. Shopify automatically hosts an updated index at /sitemap.xml.

If you run a custom-built site, a static site, or want to export a curated list of marketing landing pages, you can generate a file directly. You can paste a list of URLs into our free browser-based Sitemap.xml Generator to receive a valid XML sitemap with lastmod, changefreq, and priority fields configured without installing server software. The tool runs entirely in your browser, keeping your URL lists private.

Once your file is live on your server, submit it directly to Google Search Console:

  1. Log in to Google Search Console and select your domain property.
  2. In the left-hand navigation menu, look under the Indexing section and click Sitemaps.
  3. Under the "Add a new sitemap" input box, paste the relative path of your file (for instance, sitemap.xml).
  4. Click Submit.

Google will queue the file for fetching. The status will initially read "Submitted" and update to "Success" after processing.

Frequently Asked Questions

What is an xml sitemap used for?

An XML sitemap is used to inform search engine crawlers about which URLs exist on a site and when they were last updated. It speeds up the discovery of new or modified pages, maps out deep site architectures, and generates detailed indexing status reports in Google Search Console.

What is the difference between an XML sitemap and an HTML sitemap?

An XML sitemap is written in code designed exclusively for search engine bots to read. An HTML sitemap is a standard webpage with clickable text links designed to help human site visitors find key pages on a website.

I submitted a sitemap and my pages still are not indexed. What went wrong?

Probably nothing went wrong with the file itself. A sitemap is a discovery aid, not an indexing request. It tells Google that a URL exists, but Google still decides independently whether the page is worth keeping in its index. Pages that sit unindexed after discovery almost always have the same problem: nothing links to them internally, or there is nothing on them that another page does not already say better.

Do I have to resubmit the sitemap after I update it?

No. Google refetches submitted sitemaps on its own schedule. The old ping endpoint was retired in 2023, so any script you inherited that calls it is hitting a deprecated URL and doing nothing. Simply update the file on your server, keep your lastmod tags accurate, and let search bots fetch it during their regular crawl cycles.

Should paginated or filtered URLs go into the sitemap?

Only include URLs that are canonical and worth a searcher landing on directly. Page 2 of a category listing usually qualifies if it contains unique products or posts. Every combination of color, size, and sorting filters does not qualify. The test is simple: if you would not want that specific URL to be the primary result ranking in search, it does not belong in the file.

Explore Links to Wild

🌩
View Pricing

Link building packages from $600

🧭
About Hayk

The story behind Links to Wild

✉
Get in Touch

Book a call or send a message