Victory Digital

What is an XML sitemap and how do you create one?

Cai 4 min readSearch Engine Optimisation

An XML sitemap is a file that lists every page on your website that you want search engines to find and index. It sits on your server and tells Google, Bing and other search engines which pages exist, when they were last updated, and how important they are relative to each other.

If your site has ten pages, search engines will probably find them all through normal crawling. But if you have fifty pages, a blog with dozens of articles, or pages that are not linked from the main navigation, an XML sitemap becomes essential. It is the most reliable way to tell Google that a page exists and should be crawled.

How an XML sitemap works

An XML sitemap uses structured tags. Each entry contains the page URL and optional metadata: when it was last modified (lastmod), how often it changes (changefreq) and its priority relative to other pages on your site (priority, from 0.0 to 1.0).

Search engines use these hints alongside other signals. They do not guarantee a page will be crawled more often or ranked higher, but they ensure the page is at least discovered. Think of a sitemap as a checklist you hand to the librarian, not a guarantee that every book will be read.

Why you need an XML sitemap

Search engines discover pages by following links. If a page has no internal links pointing to it, it might never be crawled. An XML sitemap solves this by giving search engines a complete inventory of your pages.

XML sitemaps are particularly valuable when:

  • Your site is new and has few external links. A sitemap helps search engines find your pages quickly even before you have built up backlinks.
  • You have a large site with hundreds or thousands of pages. Without a sitemap, crawlers may miss entire sections.
  • Your site has pages that are not linked from the main navigation. Landing pages, campaign pages and archived content often sit a few clicks from the homepage.
  • You publish content regularly. A sitemap with accurate lastmod dates tells search engines when to come back and check for updates.

How an XML sitemap is structured

The file sits in the root directory of your website and follows the sitemaps.org protocol. Each URL entry includes a loc tag with the full web address, and may include lastmod, changefreq and priority tags.

For example, a simple sitemap for a small business site would list the homepage, the about page, the services page and a few blog posts, each with its own lastmod date and priority. The homepage would have priority 1.0, while an older blog post might have priority 0.5.

How to create an XML sitemap

Most content management systems generate XML sitemaps automatically. On WordPress, plugins like Yoast SEO or Rank Math create and update your sitemap whenever you publish or change a page. Shopify generates a sitemap automatically at yourdomain.com/sitemap.xml.

If you run a small static site by hand, you can use a free online sitemap generator or write the XML yourself. Upload the file to the root directory of your website.

How to submit your sitemap to Google

Creating the file is only half the process. You also need to tell Google where to find it.

Open Google Search Console and select your site property. Go to the Sitemaps section under Indexing in the left menu. Paste your sitemap URL (typically https://www.yourdomain.com/sitemap.xml) and click Submit.

Google will begin crawling the URLs in your sitemap and report back how many were successfully indexed. Check back in a few days to see if any pages failed to index and fix those issues.

You can also reference your sitemap in your robots.txt file. Add this line: Sitemap: https://www.yourdomain.com/sitemap.xml. This tells any search engine that supports it where to find your sitemap, even without a Search Console submission.

XML sitemap best practices

  • Keep your sitemap under 50,000 URLs and 50 MB uncompressed. For larger sites, split into multiple sitemaps and use a sitemap index file.
  • Include only canonical URLs. Do not add parameterised URLs, session IDs or filter pages that could create duplicate content signals.
  • Use accurate lastmod dates. Setting every page to last week when nothing changed erodes trust.
  • Exclude noindex pages. If you have blocked a page from indexing, it should not be in your sitemap either.

Victory Digital's technical SEO service includes sitemap audits as part of every campaign. If you are not sure whether your sitemap is working properly, start with a free SEO report at https://victory.digital/run-a-seo-report, or book a discovery call at https://victory.digital/book/discovery-call.

What are your Feelings?

Share your reaction

Click a reaction to share how useful this article was.

Share This Article