Skip to content
Glossary

What Is XML Sitemap?

An XML sitemap is a file (typically at /sitemap.xml) that lists the URLs on your website, helping search engines like Google discover, crawl, and index your pages more efficiently. While Google can find pages by following links, a sitemap ensures newly published pages, deep pages, and pages with few inbound links are discovered quickly, especially important for large sites and programmatic SEO page sets.

How an XML sitemap works

An XML Sitemap is a plain-text file using XML syntax that follows the Sitemap Protocol schema defined at sitemaps.org/schemas/sitemap/0.9. Each URL entry is wrapped in a <url> element containing a required <loc> tag (the absolute URL) and optional child elements: <lastmod> (ISO 8601 date format, e.g., 2024-03-15), <changefreq> (always, hourly, daily, weekly, monthly, yearly, never), and <priority> (a float from 0.0 to 1.0, defaulting to 0.5). The file itself is enclosed in a root <urlset> element with the appropriate XML namespace declaration. Search engine crawlers like Googlebot fetch the sitemap file directly, typically at /sitemap.xml, or discover it via the Sitemap directive in robots.txt (e.g., 'Sitemap: https://example.com/sitemap.xml'). Google recommends submitting sitemaps explicitly through Search Console to confirm receipt and monitor indexing status. Crawlers do not guarantee they will crawl every listed URL or respect changefreq and priority values as hard rules; these fields serve as hints, not commands. For large websites exceeding 50,000 URLs or 50MB uncompressed, the protocol requires splitting into multiple sitemap files and referencing them from a Sitemap Index file using the <sitemapindex> root element with child <sitemap> entries. Each child sitemap can itself contain up to 50,000 URLs. Sitemap files can be gzip-compressed to reduce transfer size, with the .xml.gz extension. Specialized sitemap extensions exist for non-HTML content: Google's Image Sitemap extension uses <image:image> child elements to surface image URLs, captions, and licenses. Video sitemaps use <video:video> tags. News sitemaps follow Google's News Sitemap specification and require publication date within the last 48 hours to qualify for Google News indexing. Each extension requires its own XML namespace declaration within the <urlset> element.

What a sitemap should include

Include all canonical, indexable URLs, pages you want in Google's index. Exclude: pages with noindex tags, duplicate pages, redirect URLs, error pages, and admin/internal pages. For large sites, use a sitemap index file that references multiple sub-sitemaps (e.g. one for blog posts, one for template pages, one for tools). Include <lastmod> to help Google prioritise recently updated pages.

Sitemap submission and monitoring

Submit your sitemap via Google Search Console (Settings → Sitemaps) and Bing Webmaster Tools. Google will also discover it automatically if referenced in robots.txt (Sitemap: https://example.com/sitemap.xml). After submission, monitor the 'Discovered', 'Crawled', and 'Indexed' counts in Search Console, a gap between discovered and indexed pages indicates indexation issues.

XML sitemap best practices

Only include canonical, indexable URLs in your sitemap, exclude pages with noindex meta tags, canonical tags pointing elsewhere, redirect chains, paginated duplicates (unless using rel=canonical correctly), and any URLs returning non-200 HTTP status codes, since submitting non-indexable URLs wastes crawl budget and signals poor sitemap hygiene to search engines. Keep <lastmod> values accurate and dynamic; setting them to today's date unconditionally is a common mistake that trains crawlers to distrust your timestamps, only update lastmod when substantive content changes occur. For large sites, generate sitemaps programmatically using server-side scripts or static site generator plugins rather than maintaining them manually, and automate submission via the Google Search Console API or ping endpoint (https://www.google.com/ping?sitemap=YOUR_SITEMAP_URL) whenever the sitemap updates. Always validate your sitemap against the official schema using tools like Google Search Console's sitemap report or the XML Sitemap Validator before submission, and monitor coverage reports regularly to catch crawl errors, excluded URLs, or discovery gaps.

Dynamic sitemaps in Next.js

Next.js 13+ generates sitemaps dynamically via the app/sitemap.ts file, returning an array of URLs with metadata. This is ideal for programmatic SEO sites where new pages are added frequently. The sitemap updates automatically as new data is added, without manual regeneration.

XML Sitemap and Canvas Builder

canvasbuilder.co uses a dynamic Next.js sitemap.ts that auto-includes all template pages, tool pages, blog posts, compare pages, glossary pages, and other programmatic SEO content, currently listing 180+ URLs.

Start building free

Frequently asked questions

How large can a sitemap be?

A single sitemap file supports up to 50,000 URLs and 50MB uncompressed. For larger sites, use a sitemap index file that references multiple sitemap files, each within the 50,000 URL limit.

Do changefreq and priority values in an XML Sitemap actually influence how Google crawls my site?

Google has publicly stated that it largely ignores changefreq and priority as directive signals, they are treated as soft hints at best and have no guaranteed effect on crawl scheduling or ranking. The only field Google consistently uses from sitemaps is <lastmod>, and only when the timestamps are accurate and consistent; it cross-references lastmod against actual HTTP Last-Modified response headers to assess trustworthiness. Focus your effort on keeping the URL list clean and lastmod accurate rather than fine-tuning changefreq or priority values.

Should I include every page on my website in the XML Sitemap?

No, your sitemap should function as a curated list of pages you want indexed, not an exhaustive dump of every URL your server can respond to. Exclude utility pages (login, cart, thank-you pages), thin content, URL parameter variants, faceted navigation duplicates, pages behind authentication, and any URL carrying a noindex directive. Including non-indexable URLs doesn't cause penalties but does signal poor sitemap quality to crawlers, potentially reducing the trust and crawl frequency applied to your sitemap over time.

Does canvasbuilder.co have a sitemap?

Yes, canvasbuilder.co has a dynamic XML sitemap at /sitemap.xml generated by Next.js, including all template pages, tool pages, blog posts, and programmatic SEO pages.