Get in touch with our team
Feature image for 23.01.2025

23.01.2025

15 min read

XML sitemaps: What they are and how to submit them

XML sitemaps were first introduced by Google back in June 2005. Back then, the underlying principle was simple: the search engine needed to discover URLs from across the internet more easily, so that they could be indexed and later retrieved to create search engine results pages (SERPs).

Sitemaps solved this discovery problem in a straightforward way, placing the onus on webmasters to create and continually update a definitive list of the important URLs on their websites. With an inventory of live pages available in one place for each site, Google could quickly discover when pages were created or removed by crawling a single URL. This, in turn, helped the search engine to maintain a healthier index, giving it more options for pages to return in response to a query.

Well-maintained XML sitemaps are also beneficial for site owners looking to attract more organic traffic, as signposting URLs in this way increases the likelihood that they’ll be discovered so that they can be surfaced in search results. For this reason, sitemap optimisation rapidly took off as an important practice in SEO – particularly after Yahoo! and Microsoft announced support for sitemaps through their respective search engines in November 2006.

This comprehensive guide to XML sitemaps answers all of the important questions you might have, whether you’re new to SEO or simply looking to up your game. Starting with the basics of generating and submitting your sitemap(s), we’ll move on to explore how you can optimise them for maximum discoverability.

There’s plenty to unpack here. Read on for a comprehensive look at the topic, or alternatively use the links below if you’re looking for something in particular.


Thanks to the outstanding results we deliver for our clients, Impression has earned a reputation as one of the best SEO agencies in the industry. If you could use our support with sitemap optimisation or any other aspect of maximising your organic visibility, reach out to our team today.

What is a sitemap?

A sitemap is a file that lists a website’s URLs to help search engines find, crawl and index them. Submitting an XML sitemap doesn’t guarantee that all pages will be indexed, but it does assist in discovery – essentially offering them up for consideration by search engines.

Sitemaps also act as roadmaps for search engines and users, clarifying the website architecture and making it easier to understand.

What’s the difference between HTML and XML sitemaps?

Sitemaps come in two formats: HTML or XML. HTML sitemaps create easy navigation for users, while XML sitemaps are specifically designed for search engines to ensure they don’t miss any important pages while crawling and indexing a site.

HTML sitemaps are usually text files with hyperlinked text and are available for users on the website in the footer, or in some cases on a dedicated landing page. XML sitemaps are written in Extensive Markup Language (XML), which is a way to structure data using tags. These are submitted to search engines via a URL, and can also be accessed by users at these locations.

Do you need a sitemap?

It’s not a requirement to have a sitemap. That said, creating and maintaining an up-to-date inventory of pages through an XML sitemap does help search engines to discover, crawl, and index your content. 

Still not convinced? Here are some more reasons why you should consider a sitemap:

  • Incomplete indexing: Without an XML sitemap in place, search engines might not discover all of your pages on a website, causing incomplete indexing. Pages that are not in the index cannot rank in search results.
  • Internal linking: If a page has poor internal linking, having a sitemap can help that page be discovered. This isn’t a substitute for following internal linking best practices, but including a page in your sitemap is an excellent place to start.
  • New websites: If you launch a new website and it naturally lacks backlinks, then a sitemap can make your website more discoverable for search engines. Learn more about how external links towards your site impact its performance in our guide on the importance of link building.
  • Larger website: If you operate a larger website with thousands of pages, sitemaps can help search engines discover content more easily. We’ve seen clients with enterprise-level sites miss out on visibility by failing to include all of their important URLs in XML sitemaps.
  • Regularly update your website: If you regularly update your website with content such as new products or blogs, having a sitemap can help search engines keep on top of any changes that occur over time.

What does an XML sitemap look like?

An XML sitemap should follow a specific format to guide search engines. Here’s how it should typically look:

<urlset>
    <url>
        <loc>http://www.example.com/</loc>
        <changefreq>weekly</changefreq>
        <lastmod>2024-01-01</lastmod>
        <priority>1.0</priority>
    </url>
</urlset>

This easy-to-crawl format is designed to allow search engines to understand the sitemap quickly and correctly. You may notice that sitemaps include key features such as:

  • <urlset>: The part that contains all of the URLs. 
  • <url>: A tag that contains each URL.
  • <loc>: The location of an individual URL.
  • <changefreq>: Shows how frequently the page is likely to change and it’s a way to tell search engines when to expect a URL’s content to change.
  • <lastmod>: Tells you the last time the page was modified.
  • <priority>: Shows the importance of a URL compared to other URLs on the same site with values from 0.0 to 1.0. The higher the value, the more important the page is. 

While it’s useful to know what an XML sitemap looks like and the coding elements included, we rarely have to create these ourselves. Many content management system (CMS) providers offer the functionality to create an XML map automatically in some form or other. For example, the Yoast SEO sitemap plugin is a popular choice for WordPress sites. Read on to discover other ways to generate an XML sitemap.

Lines from an Impression sitemap, with <url>, <loc>, and <lastmod> elements

Sitemap types

Earlier, we explored how there are two different sitemap types: XML sitemaps and HTML sitemaps. However, XML sitemaps are also further divided into types because they serve different purposes, such as enhancing the indexing of images and videos.

  • Image sitemaps: Image sitemaps can help search engines like Google index visual content while allowing you to add specific details like locations and captions.
  • Video sitemaps: This type of sitemap helps your videos appear in the search results and can also help to provide metadata about the video’s content.
  • News sitemaps: These highlight recently published articles that are less than two days old. This type of sitemap is designed and highly beneficial for news websites and can list up to 1000 URLs at a time. If there are more URLs than this, a sitemap index file is needed to organise them.
  • Mobile sitemaps: A type of sitemap that helps search engines understand site structure when many dedicated mobile pages are present, which is beneficial for ensuring this content is properly indexed.

XML sitemaps SEO best practice

Following SEO best practices for your XML sitemap will ensure search engines can efficiently crawl your most important pages. And as we’ve seen, this is a vital first step in the journey towards getting them indexed and later ranked in search results. Read on for top tips from our in-house experts.

Keep URLs up to date

Make sure URLs in your sitemap are updated regularly. Whenever old pages are removed from the site, make sure that they’re also removed from your sitemap. By the same token, new pages that you want to be visible in search results should also be added to your sitemap. It’s worthwhile investing in an automated solution to eliminate the need for time-intensive manual tweaks to your sitemap.

Don’t include redirects

If you apply a 301 redirect to a URL, make sure to remove the origin URL from your XML sitemap and replace it with the target URL. Automatically generated sitemaps will do this for you, but if you are manually updating your sitemap then ensure not to miss this step, or you could end up confusing search engines. 

Include your sitemap in your robots.txt

Your robots.txt file is a useful tool for telling search engines which pages and directories should and shouldn’t be indexed for search results. Signposting the URL of your XML sitemap via robots.txt is best practice, as it clearly shows search engines you want them to access and index certain URLs.

Create individual XML sitemaps for different areas of your site

It is common for webmasters to create several different sitemaps, each focusing on its own area of a website. Say, for example, you have an extensive collection of blogs – these should have their own sitemap to differentiate them from other page types. Ecommerce sites may also wish to split out category and product pages into distinct groups or themes via sitemaps.

Chris Rogers, senior technical SEO specialist, offers this advice about creating individual sitemaps:

Once you’ve broken out your sitemaps, their URLs should then be listed on an XML sitemap index page. See Impression’s sitemap index for an example.

Not only does this help search engines and users to understand your site architecture, but it also offers benefits in terms of spotting where indexation issues are occurring. Using this method of splitting out sitemaps, you might spot that a certain area of your site has many pages that aren’t making it into the index, prompting you to investigate and resolve any problems that are specific to that area.

Impression’s sitemap index page

Common errors in XML sitemaps and how to fix them

Website managers can run into a number of issues when formatting and submitting XML sitemaps. To help you avoid these and enable search engines to crawl your most important URLs effectively, we’ve compiled a list of the most common errors – and how to fix them – below.

Whitespace errors

Plugin conflicts can result in lines of whitespace appearing at the top of your XML sitemap, preventing it from being crawled by search engines. You’ll notice this is happening if you spot one of the following errors in Google Search Console under the Sitemaps tab:

  • XML or text declaration not at start of entity
  • XML declaration allowed only at the start of the document

Typically, the fix for this involves checking for conflicts between your sitemap plugin and other plugins. In some cases, a website’s theme can also be creating whitespace errors in its sitemap.

Incorrect URL formatting

We’ve seen how the URLs in XML sitemaps should be formatted, and if any sections of your sitemap do not conform to this standard, this can prevent them being crawled. You’ll usually find that this isn’t a problem if you use an automated sitemap solution, but it can crop up for sites that rely on manual updates. 

Google Search Console and Bing Webmaster Tools will highlight the location of any URL formatting errors and the problem that needs addressing, so take a look in these platforms and make any edits that are required accordingly.

Sitemaps exceeding limits

If you have a large website, you’ll need to split URLs up into groups of no more than 50,000, as this is the limit for the number of pages in any one XML sitemap file – equally, your individual sitemaps must not exceed 50MB. Any URLs over the 50,000 limit in one individual sitemap will not be read by search engines.

Missing or incorrect metadata

Including accurate metadata helps enrich search engines’ understanding of changes to your content over time. We know that Google in particular uses the <lastmod> element to gather data on when the most recent changes were made to a page, and this date can be displayed in search engine result snippets:

Users who notice a recent date alongside a search result may be more inclined to click on it, which can boost click-through rates (CTRs) for your pages. And as we know that content freshness is a ranking factor, maintaining the <lastmod> element effectively can also support improved organic rankings.

But it’s equally important to avoid attempts to game the system, as Google can easily spot inaccurate <lastmod> changes that occur when a page hasn’t been altered. Jonathan Theuring, senior SEO strategist, cautions:

Only update <lastmod> when this aligns with noteworthy content changes – or search engines could choose to ignore this element going forward.

Overall, then, the key is to remember to include metadata like the <lastmod> element in your XML sitemap, and always be honest and accurate when doing so.

How to generate a sitemap

Usually generating a sitemap is an easy task as your CMS or plugin will automatically create and update your XML sitemap for you. Discover more platform-specific details on sitemap generation and checking auto-generated sitemaps below.

For sites using WordPress, Shopify, Wix or Squarespace

If you use WordPress, Shopify, Wix, or Squarespares, you can check your XML sitemap by typing in yourdomain.com/sitemap.xml in your browser.

For sites using other CMS providers

If you are using a different CMS system than the sites listed above, we suggest reaching out to find your site’s XML sitemap. Most CMS providers should automatically generate one, but if you’re unsure how to access this, contact the platform’s support team.

For sites whose platform doesn’t provide an XML sitemap

In the rare case that the platform you use for your site doesn’t provide an XML sitemap, you can use a sitemap generator tool where you enter your website’s URL, and the tool will scan your site and create a sitemap file. This should be downloaded in an XML format. We recommend using our Sitemap Extraction Tool to easily extract and view your website’s XML sitemap.

How to submit your XML sitemap to Google

Now that you have your XML sitemap for your website, it’s time to learn how to submit it to Google. You can also see our guide to Bing Webmaster Tools for the equivalent process for submitting sitemaps to Bing.

Step 1: Log into Google Search Console 

Log into your Google Search Console account. If you don’t have an account, create one and set up your website.

Step 2: Go to ‘Sitemaps’

Go to the ‘Sitemaps’ section under Indexing. On this page, you will find ‘add a new sitemap’ and ‘submitted sitemaps’.

Step 3: Submit your sitemap

If you’ve followed the steps in the ‘how to generate a sitemap’ section, you should have your site’s XML sitemap to hand and ready to upload. Submit your sitemap URL and you’ll receive confirmation that this has been successful.

Your sitemap will eventually appear in the ‘submitted sitemaps’ section. This section informs you on key information such as when the sitemap was submitted and how many pages Google has discovered. If there are no issues with the sitemap, it will have a green ‘success’ status. 

How to test your XML sitemap

Having submitted your XML sitemap, you now need to test it regularly – carrying out checks in tools like Google Search Console and Bing Webmaster Tools. During these checks, you may spot errors that need addressing, and we’ve explained the messaging you’ll commonly see below.

“Couldn’t fetch”

This status means Google couldn’t access your sitemap. This usually happens if your sitemap URL is incorrect or if there are connectivity issues. Make sure your server isn’t blocking your Googlebot, your sitemap is in the right location, with the correct URL.

“Sitemap has X errors”

Google was able to read some of the sitemap, but found certain errors. These errors are usually due to broken URLs, improper formatting, redirects, or blocked pages. Google will let you know specifically what URLs and errors these are, making it easy to identify and fix any problems.

SEO by Impression

We’ve taken you through a detailed overview of XML sitemaps, including what they are, their importance, and how to generate, submit, and maintain them for SEO best practice. 

Have a question about how this might apply to your site? Speak to our team today or check the FAQs below for a quick answer.

XML sitemap FAQs

Do I need an XML sitemap?

In short, yes it’s highly recommended to have an XML sitemap. It helps search engines to discover your content, stay abreast of any changes, and gain an understanding of your site architecture. By splitting out sitemaps, you can also spot where common indexation issues are occurring across different areas of your site.

How often should you update your sitemap?

A sitemap should be updated every time new or existing content is added or updated on a website, as well as when pages are removed. This will make sure search engines are aware of any updates and can crawl and index pages efficiently.

What happens if my sitemap has errors? 

If your sitemap has errors, search engines may struggle to crawl and index your pages properly. Investigate and fix any errors that appear in Google Search Console or Bing Webmaster Tools.

How many URLs can an XML sitemap have?

An XML sitemap can have up to 50,000 URLs. The total size of the sitemap cannot exceed 50MB. If you have a website that exceeds this, you can create multiple sitemaps and use a sitemap index to link them together.

Should I include noindex pages in my sitemap?

Pages that have noindex applied via robots.txt or robots meta tag should not be included in your sitemap. Adding these pages can confuse search engines and make your sitemap less effective, so focus on URLs you want to be indexed.

Can a sitemap improve my SEO rankings?

While sitemaps don’t boost your SEO rankings, they play a role in helping search engines discover your pages. By using a sitemap, it can ensure all your important pages are crawled, leading to better visibility and improving SEO performance over time.