What It Is and Easy methods to Create One
10 min read
What Is an XML Sitemap?
An XML sitemap is a web site file that lists pages you need serps to index. It additionally supplies further data, like when the web page was final up to date.
XML stands for Extensible Markup Language. It’s a format that permits simple storage of URL information and makes it simpler for serps to parse the information.
The XML sitemap seems to be one thing like this:

Having an XML sitemap shouldn’t be a requirement. However it could assist serps uncover your new and up to date pages. Which suggests it could increase your website positioning.
Google launched XML sitemaps in 2005. Different serps like Yahoo and Microsoft joined shortly after.
On this submit, we’ll check out whether or not you want a sitemap, in addition to varied sitemap varieties and finest practices. Then, we’ll cowl how you can create, test, and submit your XML sitemap.
Do I Want an XML Sitemap?
Google supplies example cases when having a sitemap might not be needed.
These embrace circumstances when your website has lower than 500 pages. Or when your pages are correctly internally linked.
So you might ask: Do I want a sitemap if I’ve a small web site with sturdy inside linking?
The reply is: You don’t. However it is best to have one anyway.
Right here’s why:
- The hassle it takes to create a sitemap is minimal
- Having a sitemap can solely be helpful to your website (and can by no means damage it)
- Having a sitemap can pace up the method of Google discovering your pages
As Gary Illyes from Google confirmed, XML sitemaps are the second most important source for Google to find new URLs.
Why ignore it?
And, after all, having an XML sitemap is an absolute should for those who personal a big web site (1000’s of pages) and/or your web site is new and doesn’t have many hyperlinks.
XML Sitemap Sorts
There are numerous varieties of XML sitemaps.
Google helps sitemaps for different types of content. Specifically:
You’ll be able to both combine these particular media varieties into a daily sitemap or create devoted sitemaps for them.
Though most web sites solely want one easy sitemap, there are circumstances when you might want a number of sitemaps or sitemaps for various file varieties.
Say your website has an enormous variety of indexable URLs. XML sitemaps have a dimension restrict of fifty,000 URLs or 50MB. So that you’d want to make use of a number of sitemaps for those who exceed that restrict.
Lastly, you should use separate sitemaps for varied varieties of pages, equivalent to weblog posts or creator pages.
When you use a couple of XML sitemap, use a sitemap index. It’s a sitemap that lists all of your different sitemaps.
Right here’s what a sitemap index can appear to be:

XML Sitemap Greatest Practices
Now, let’s check out Google’s technical guidelines and finest practices for XML sitemaps and how you can arrange your XML sitemap accurately:
- Solely embrace URLs you wish to have listed by serps. (For instance, when you have a number of variations of the identical web page, embrace solely the canonical URL.)
- Solely embrace URLs that return a 200 standing code. (No redirects or 4xx/5xx error standing codes.)
- Ensure that a single sitemap file is lower than 50MB or 50,000 URLs. Use a number of sitemaps if wanted.
- When you use a number of sitemaps, create an index sitemap that can checklist all of them.
- Ensure that your sitemap is UTF-8 encoded.
- Embrace hyperlinks to localized model(s) of every URL. (See documentation by Google.)
- Replace your sitemap each time there’s a brand new URL or an previous URL has been up to date.
- Embrace details about when the web page was final up to date (the “lastmod” attribute).
- Hyperlink to your sitemap out of your robots.txt file. (Learn concerning the sitemap directive in robots.txt.)
- Submit your sitemap to Google. (You’ll learn to do it in one of many next chapters.)
The excellent news is that for those who use a CMS (content material administration system), plugin, or sitemap generator to create a sitemap.xml file, it’ll be certain that it meets many of the necessities listed above.
Now, you’re able to learn to create an XML sitemap.
Easy methods to Generate an XML Sitemap
Most CMSs create and replace your XML sitemap routinely. These embrace:
There’s usually little to no room for handbook edits of your sitemap in a CMS. However that’s not an issue for many customers.
So that you don’t must do something for those who use a kind of.
Word: When you don’t use a CMS, soar to the XML Sitemap Generators part.
XML Sitemap Plugins in WordPress
When you’re a extra superior WordPress person who needs to have full management over the sitemap.xml file, you might have the choice to switch the default one.
For instance, there is no such thing as a easy solution to exclude sure pages from a WordPress-generated XML sitemap (aside from enhancing the PHP code).
That is the place plugins turn out to be useful.
Usually, you should use two varieties of WordPress plugins to create an XML sitemap:
We’ll take a more in-depth have a look at Yoast website positioning, probably the most well-liked WordPress website positioning plugins.
Word: When you don’t have an website positioning plugin but, comply with our detailed directions on how you can set one up in our WordPress website positioning information.
As soon as put in, Yoast website positioning each creates a brand new sitemap and replaces the native WordPress sitemap routinely.
You’ll be able to go to “Yoast website positioning” settings within the left menu of the WordPress dashboard.
Go to “Normal” settings and click on the “Options” tab. Right here, you will discover the “XML Sitemap” part.

The characteristic will probably be “On” routinely.
To view your precise XML sitemap, click on the query mark image. Then, click on the “See the XML sitemap” hyperlink.

Yoast routinely creates an index sitemap that consists of particular person sitemaps for posts, pages, classes, authors, and many others.
It would appear to be this:

After clicking the hyperlink to a person sitemap, you’ll see an inventory of URLs it consists of:

If you wish to exclude some pages out of your sitemap, you’ll be able to merely disable their indexing via the Yoast plugin.
This implies serps gained’t present these pages in search outcomes. And Yoast will take away them from the sitemap.
To exclude an particular person URL, that you must go to the editor of that particular web page or submit.
On the backside, you’ll discover the Yoast website positioning settings. Develop the “Superior” part.

Then, within the “Enable serps to point out this Put up in search outcomes?” part, choose “No.”

To exclude entire content material varieties, archives, and taxonomies, you’ll must go to the Yoast website positioning “Search Look” settings.
Say you don’t need Google to index your creator archives.
Go to the “Archives” tab.
Then, below “Present creator archives in search outcomes?,” swap the button to “Off.”

This setting can even take away the creator sitemap out of your sitemap index.
To be taught extra about customizing your sitemap index, learn this guide by Yoast.
XML Sitemap Turbines
When you don’t use a CMS, you might have two choices in the case of creating an XML sitemap:
- Creating the sitemap manually
- Utilizing a sitemap generator
Making a sitemap manually will be OK when you have a static web site with a few pages. However this feature is tedious for bigger websites with content material that modifications often.
It’s typically extra sensible to make use of a sitemap generator—a software that creates the sitemap for you routinely.
We advocate utilizing a downloadable desktop software (like Inspyder Sitemap Creator or Sitemap Writer Pro) that updates your sitemap each time a web page is created or modified.
Tip: Learn our submit about the most effective sitemap turbines to be taught extra about your choices.
Easy methods to Test Your XML Sitemap
To test the performance of your sitemap, you should use Semrush’s Website Audit software.
All that you must do is to create a free account (no bank card wanted) and arrange your first crawl. (This setup information will make it easier to get began.)
The overview of your audit will look one thing like this:

To seek out any XML sitemap points, head to the “Points” tab.

Then, seek for “sitemap” to solely see points associated to your sitemap.xml file.

The problems will probably be divided into three classes—errors, warnings, and notices—primarily based on their severity.
In case the problem pertains to a number of URLs listed in your sitemap, you’ll be able to click on the hyperlink associated to that difficulty and see all affected URLs.

To be taught extra concerning the difficulty, you’ll be able to at all times click on the “Why and how you can repair it” hyperlink. A modal window will seem, describing the problem and proposing methods to repair it.
Right here’s an instance of this modal for the “Sitemap.xml not indicated in robots.txt” warning:

If you wish to be taught extra concerning the Website Audit software and the assorted technical website positioning features of your web site it could test for you, try our detailed Website Audit information.
Additionally, think about performing an total technical website positioning audit to your web site.
Easy methods to Submit Your XML Sitemap to Google
Though Google crawlers will ultimately choose up your sitemap on their very own, it’s best follow to submit the sitemap’s URL to Google.
Primarily as a result of:
- It would pace up the method of discovering your sitemap
- It would make it easier to determine points Google may need together with your sitemap
You are able to do this in Google Search Console.
Word: When you don’t have a Google Search Console account, learn our article concerning the software and how you can set it up.
First, open the “Sitemaps” dashboard in Google Search Console. You’ll discover it within the left menu, below the “Indexing” part.

Copy and paste the URL of your sitemap to the “Add a brand new sitemap” area and hit “Submit.”

When you’ve got a number of sitemaps, you don’t must submit each individually. Simply submit your index sitemap that lists your entire different sitemaps.
Your sitemap gained’t be processed instantly. (The truth is, it could take as much as a few days.)
As soon as Google indexes your sitemap, it’s going to present a inexperienced “Success” standing subsequent to your sitemap within the “Submitted sitemaps” part.

If there are points together with your sitemap, the standing will probably be “Has errors” or “Couldn’t fetch.”
To view the detected points, click on the row containing your sitemap. Google additionally supplies detailed instructions for every of the potential errors.
FAQs
Do All Pages Must Be in an XML Sitemap?
Your sitemap ought to embrace solely the pages you need serps to index and present of their search outcomes.
So it shouldn’t embrace pages you wish to exclude from search outcomes. These can embrace non-canonical duplicate pages, admin pages, pages hidden behind a paywall, thanks pages, and many others.
Furthermore, an XML sitemap ought to solely checklist legitimate pages (pages that return a 200 standing code). Ensure that it doesn’t embrace pages with every other standing codes, equivalent to:
- 3xx: pages with redirections (e.g., 301 everlasting redirect)
- 4xx: pages which can be unavailable (e.g., 404 web page not discovered)
- 5xx: pages returning server errors (e.g., 502 unhealthy gateway)
What’s the Distinction Between HTML and XML Sitemaps?
The principle distinction between HTML and XML sitemaps is their objective. HTML sitemaps assist guests with navigation, whereas XML sitemaps assist serps uncover pages.
Google recommends utilizing XML sitemaps for website positioning functions.
In terms of HTML sitemaps, Google Search Advocate John Mueller recommends specializing in having clear navigation and good website structure as an alternative of utilizing HTML sitemaps. He states that “they need to by no means be wanted.”
Ought to I Use the “Precedence” and “Changefreq” Attributes in My XML Sitemap?
“Precedence” and “changefreq” are two non-obligatory attributes that may be added to every URL listed in an XML sitemap.
Google has repeatedly said (e.g., in this Webmaster Central hangout) that they don’t play a big position in sitemaps.
Right here’s what they do:
- Precedence attribute: Offers every URL a precedence worth from 0 to 1. For instance, giving a web page precedence of 0.8 informs serps that you simply deem this web page pretty vital.
- Changefreq attribute: Informs serps how typically a web page is up to date (can embrace values like “at all times,” “each day,” “weekly,” and many others.)
Though these might appear to be helpful attributes to incorporate in a sitemap, the URL of a web page and the “lastmod” attribute are actually the one two issues which can be vital for Google, as John Mueller confirmed on Twitter:
The URL + final modification date is what we care about for websearch.
— John Mueller is usually not right here 🐀 (@JohnMu) August 17, 2017
How Do I Know if My XML Sitemap Is Set Up Appropriately?
With Semrush’s Website Audit software, you’ll be able to audit any web site and test for varied points associated to XML sitemaps.
All that you must do is to create a free account (no bank card wanted).
The software will test whether or not a sitemap.xml file is current. Then, it’s going to checklist any formatting errors and pages that ought to not seem in a sitemap.
It would additionally test whether or not your sitemap meets the technical necessities (e.g., the dimensions restrict) and finest practices (e.g., being linked to out of your robots.txt file).