The Definitive Guide to XML Sitemaps

Here’s everything you need to know about XML sitemaps and your website.

What Is an XML Sitemap?

An XML sitemap is only a list of pages on your website. It’s written in a way that makes it simple for a computer to read it- hence it’s formatted in XML. XML might look like HTML, but that’s because HTML is a form of XML.

Some XML sitemaps contain more information than a list of pages. For instance some XML sitemaps give particular pages a priority or suggest a how often a page gets updated. You can add that information if you want. Google ignores it.

XML sitemaps can list more than pages on your site. They can also be lists of:

  • Images
  • Videos
  • News Items
  • More sitemaps. Yes, that’s right- sometimes a sitemap contains more sitemaps.

When most people say “XML sitemap”, they mean a list of pages of a website.

Does My Site Have an XML Sitemap?

That can be hard to tell for every site. Here’s a couple places you can check:

  • The typical filename for an XML sitemap is simply, “sitemap.xml”. Enter that after the end of your domain name like this: http://www.website.com/sitemap.xml If your sitemap uses this filename, you’ll find it here. If not, that’s okay. The XML sitemap doesn’t have to be named like this. If it’s not there, try to…
  • View your site’s robots.txt file. You can get to this by entering /robots.txt to the end of your domain name. For instance, http://www.website.com/robots.txt  Sometimes your XML sitemap will be listed in this file after “sitemap:” (without the quotes). If it’s not there, try…
  • Logging into your content management system (your CMS; for instance, WordPress is a CMS). Look around in here- your CMS (or one of it’s plugins) might be creating one for you. This should tell you how to find yours. If it’s not there…
  • As the people who build your website. They might know how to find it- if they’ve even created one. If they haven’t, that might be okay. Not every website needs an XML sitemap.

Does My Site Need an XML Sitemap?

  1. Is your site large? If so, you need an XML sitemap. How large is “large”? That’s hard to say- there’s do official number. Let’s say: if you can’t tell me all the pages on your site, you need one.
  2. Is your site updated frequently? If so, you need an XML sitemap. How frequent is “frequently”? If you can’t remember the last time you updated your website, an XML sitemap won’t help.

XML sitemaps help Google find the pages of your website. It’s only a list of your sites’s pages. Every time Google comes to your website it will crawl a few pages- but not every page of your website. But if you have an XML sitemap, Google will download it and see a list of all your pages. From there, if it notices something new, it might start by reading those pages. Without an XML sitemap, Google may find your new pages- eventually. Why would you want to wait?

Can My Site Rank without an XML Sitemap?

Yes.

XML sitemaps are about suggesting pages for Google’s index. XML sitemaps are not a factor behind how Google decides which sites should rank better. At the same time, if Google can’t find your page (because there are no links to it) it can’t serve it in the search results. In that case an XML sitemap might help a page rank better- but only because it shows Google that it exists.

How Can I Make an XML Sitemap?

The best way to create an XML sitemap is through your content management system (CMS). For example, WordPress offers several plugins that dynamically create an XML sitemap for you. This is the best option because it is automatic.

There is at least one limitation to an automatically-generated XML sitemap: sometimes it contains pages you don’t want Google to find.  For instance, if you’re using confirmation pages after someone submits a form, you don’t want Google to find them. In some cases, archival pages (such as date or category pages for blog posts) create duplicate content that you might not want to bother Google with. Even the best XML sitemap plugin should allow you to edit which pages are in it- and which aren’t.

If you don’t have a CMS, or your CMS doesn’t allow you to automatically create an XML sitemap, you might need to create one from scratch. There are several online tools that will allow this (just Google them) and even some desktop tools that can help.

There are a few drawbacks to manually created XML sitemaps. For one, you have to keep making them. If you’re updating a website frequently (and you should be, anyway) then you need to create a new XML sitemap each time. This can be time-consuming.

Another drawback of a manually created XML sitemap is making sure everything is in there, that should. These external tools create an XML sitemap by crawling your site. If a page exists, without any links to it, the best tool won’t be able to find it and will end-up leaving it out of your sitemap. This defeats one of the most important values of an XML sitemap: helping Google find pages it might otherwise miss. Along with this issue is another: some tools limit the size of your XML sitemap. They may charge you to crawl your entire site.

Of course, even a manually created XML sitemap can include pages you might not want Google to find. Just like an dynamic XML sitemap, you might need to do a little editing here, too.

Of course, you could ask a developer to write a program that creates an automatic XML sitemap for you. If you go this route, make sure there’s a way for you to edit what goes in there, and that it includes everything you want. You’ll also need the URL for your new sitemap, so you can show it to the search engines.

How Can You Submit Your XML Sitemap to Google?

There are two simple ways to submit your XML sitemap to Google.

  1. Add a reference to your XML sitemap to your robots.txt file. Every time Google visits your site, it reads this file. So, if you add your XML sitemap reference here, Google will find it. At the end of your robots.txt file, add one additional line of information (of course, use the correct address for your XML sitemap, rather than my example):sitemap: http://www.website.com/sitemap.xml
  2. Submit it to Google using Search Console. To do this you first need a Google Search Console account. Once you have that go to Crawl > Sitemaps and you should see a big button that invites you to “Add/Test Sitemap”. Press that button to submit it to Google. Note: if you have a sitemap that contains other sitemaps, you only need to submit the first sitemap to Google. Google will find the other sitemaps.
  3. Why not both? If you add your XML sitemap to your robots.txt file, more search engines will be able to find it besides Google. If you submit it to Google, Google will tell you if there are any errors in your sitemap, that you need to fix. I can’t think of a reason you wouldn’t want to do both these things.

How Big Can My XML Sitemap Be?

Both Google and Bing will only handle your sitemap if it is less than 50,000 URLs and less than 50MBs in size.

This is why you might want an XML sitemap to list other XML sitemaps (which I mentioned, above). If you have 200,000 pages, you would need to break this into four, 50,000 page XML sitemaps. Of course, if you have so much data in your XML sitemaps that they’re bigger than 50MBs, you need to break those down into smaller sitemaps, yet again.