Site builders and content writers use various techniques to make their sites easier to discover through search engines. One technique that’s often overlooked is the XML sitemap.
What’s a sitemap?
An XML sitemap is a list of all pages on your site, and it makes sure that nothing’s missed when search engines crawl your site.
In the sitemap, each page is listed with its URL. Some sitemaps might also include information about when each page was last modified, how often each page is generally updated, and how important each page is compared to other pages on the site.
Why should I create a sitemap?
The more information you give to search engines, the more likely your site is to appear in relevant search results. Sitemaps are just one more way of ensuring that search engines have all the information.
Search-engine crawlers work by following links from one page to another. A sitemap ensures that search engines know about every page on your site—even if the crawler would normally miss it.
Okay, how do I build a sitemap?
There are a few different ways you can build a sitemap. I’ll first explain how to generate a sitemap on Moboom, but I’ll also explain how to build one with a sitemap generator and how to build one manually.
Generate a sitemap on Moboom
Every Moboom site comes with a sitemap, which you don’t need to set up. To see your sitemap:
- Go to your site’s URL /sitemap.xml. For example example.site.moboom.com/sitemap.xml.
By default, Moboom uses your site's Moboom subdomain when listing each page in the sitemap (example.site.moboom.com/blog...). If you’ve set up a custom domain for your site (like example.com), you can instead use this domain for your sitemap. (If you haven’t set up a custom domain, but you’d like to, check out the Custom Domain guide.)
To use a custom domain for your sitemap:
- Open your site in the Site Studio, and on the left menu, click Domains.
- Under Site Map Domain, select your domain (for example, example.com), and then click Save Domain Settings in the upper right.
- Next, generate a new sitemap using that domain. So, on the left menu, click Settings.
- Now, in the upper right, click Generate Site Map to generate a new sitemap.
Generate a sitemap with a sitemap generator
Every sitemap generator works a little differently. A decent one can be found at xml-sitemaps.com, but in general, you can just enter XML sitemap generator into your favorite search engine and select one from the results.
Here are few tips when generating a sitemap:
- Use your top-level domain. To make sure the generator properly maps your site, give it your top-level domain without any pages after it. So use example.com, and not example.com/home.
- Don’t set a change frequency. Setting a change frequency for each page can help search engines understand how often to check a page for new content. However, this setting isn’t necessary. And if you’re using a free generator, then you’ll probably have to set the frequency for the whole site—even though it probably varies from page to page.
- Don’t set a priority. Setting a page’s priority compared to other pages on the site can help search engines understand which pages to display first. Like with change frequency, this setting isn’t necessary, and you probably shouldn’t use it unless you have fine-grained control, which free generators won’t offer.
Manually build a sitemap
If you want to manually build a sitemap, you’re probably familiar with XML. If you’re not, I recommend that you use a sitemap generator (or just build a site on Moboom).
The standard sitemap schema is called Sitemap Protocol 0.9, and you can find it at sitemaps.org. It’s pretty straightforward, but I’ll summarize it here.
A sample sitemap might look something like:
<?xml version="1.0" encoding="UTF-8"?>
Here’s an explanation of each element:
<urlset> Required. Top-level tag that encapsulates all other tags.
<url> Required. Parent tag for each page. The sitemap is made up of url tags.
<loc> Required. URL of the page.
<lastmod> Optional. Date the page was last modified. Use the W3C Datetime format.
<changefreq> Optional. How often the page is likely to change. Like with any value in the sitemap, this won’t dictate how often search engines should index the page, but it will provide some guidance. The values for changefreq are:
- always Use for pages that change each time they’re accessed.
- never Use to describe archived URLs that will never change.
<priority> Optional. How important the page is compared to other pages on your site. Use values from 0.0 to 0.1. Basically, this is just additional information that a search engine can use when determining which of your pages to return. For example, you might give individual blog posts a higher relevance than your blog homepage. Remember that this setting is just guidance and won’t dictate how search engines index your pages.
How do search engines find my sitemap?
The first step is to upload the sitemap to your site. You can put it anywhere as long as it’s actually on your site. With Moboom sites, the sitemap is at sitemap.xml—which is example.site.moboom.com/sitemap.xml or example.com/sitemap.xml.
You can tell search engines how to find your sitemap in a couple different ways.
Tell them directly
The easiest way for a search engine to find your sitemap is for you to tell the search engine where to find it.
Now that your sitemap is uploaded, tell Google about it:
- Create a Google Webmaster account, and add your site (see Google Webmaster Tools for your Moboom site).
- Sign in to your Google Webmaster account, and then click your site to open it.
- From the menu on the left, click Crawl, and then click Sitemaps.
- In the upper right, click Add/Test Sitemap.
- In the textbox, type the location of your sitemap, and then click Submit Sitemap. So for a Moboom site, you’d just enter sitemap.xml.
Through your robots.txt file
Search engines can also find your sitemap through your robots.txt file. In case you’re not familiar with robots.txt, it’s a file on your site at example.com/robots.txt.
When a web crawler follows a link to your site, like example.com/blog/another-insightful-blog-post-by-me, the web crawler checks for a robots.txt file at the top level of your site—for example, example.com/robots.txt. The file tells the web crawler how to index your site, and if there are any pages or directories that it should ignore.
For detailed information on using a robots.txt file, check out Google’s explanation.
You can use your robots.txt to tell web crawlers where to find your sitemap—just add the following line:
Of course, replace example.com/sitemap.xml with location of your sitemap. You can add the line anywhere in the file (no need to add a separate user-agent line).
So to add this line to your Moboom site:
- Open your site in the Site Studio, and click Settings from the menu on the left.
- Under Robots, in the robots.txt box, paste in Sitemap: followed by the location of your sitemap. For example:
Tip The location of your sitemap is located in the upper right, under Sitemap.
- Next, click Save Settings in the upper right to save your changes.
Congrats! You’ve created a sitemap and told search engines where to find it. Now you can be sure that crawlers are seeing every page on your site.