How To Use XML Sitemaps To Boost SEO
SEO keeps changing, and what worked before might not work now. This is true for XML sitemaps, too, which have been around since the early days of SEO.
The problem is that there’s a lot of mixed advice online. It can be hard to know what’s helpful and what’s not, especially when people post tips on forums and social media.
Most of us know that it’s important to submit a sitemap to tools like Google Search Console and Bing Webmaster Tools. Adding it to the robots.txt file is also useful. Doing this helps search engines find new or updated content faster, crawl the right pages, and even show you reports that help find SEO problems.
But sometimes, we miss the small details that can make sitemaps even more useful for SEO.
What Is an XML Sitemap?
An XML sitemap is a file that lists all the pages on your website.
It works like a map for search engines and other systems, as an AI tool. It helps them know what content is there and how to get to it.
For example, if your site has nine pages, a search engine can see them all in one go by looking at your XML sitemap. Without it, the search engine may need to go through five different links just to find one of those pages.
This is really helpful for websites that:
- Have many pages or deep navigation
- Add new content often
- Update pages regularly
- Have pages that are not linked well inside the site
- Don’t have many links from other websites
Even though search engines can still find your pages without a sitemap, adding one shows them which pages you think are important.
A sitemap doesn’t promise that your pages will get indexed or rank better. But submitting one does make it more likely that your content will be seen faster.
How To Create a Sitemap
There are two main ways to make a sitemap: static or dynamic.
A static sitemap is one that needs to be updated by hand. Tools like Screaming Frog can help create it. But there’s a problem — if a new page is added, or an old one is deleted, the sitemap becomes outdated. Also, if the content of a page changes, the sitemap won’t update that change automatically.
So, unless we want to update the sitemap every time we change something, static sitemaps are not the best choice.
A dynamic sitemap, on the other hand, updates itself. It changes automatically when new content is added or updated on the website.
There are three ways to make a dynamic sitemap:
- Ask a developer to build it with clear instructions.
- Use a tool that creates dynamic sitemaps.
- Install a plugin on the website, like the Yoast plugin on WordPress.
Format of a Valid XML Sitemap
To work properly, a sitemap needs three things:
- XML Version – This shows what type of file it is.
- UTF-8 Encoding – This makes sure all characters are understood.
- Namespace – This tells search engines what rules the sitemap follows. Most use: http://www.sitemaps.org/schemas/sitemap/0.9.
After that, the sitemap lists each page using a URL container. For each page, include these two parts:
- Loc (Location) – This is required. It shows the full, correct web address of the page. It should include “http” or “https” and mention if “www” is used or not.
- Lastmod (Last Modified) – This is optional, but good to use. It shows when the page was last updated or published. It helps search engines know which pages are new or changed.
Avoid mistakes like updating the lastmod tag just because the sitemap was created, not because the actual page changed. Also, do not try to trick search engines by changing the date without updating the page — this can cause search engines to ignore the sitemap.
There’s no need to use the Changefreq or Priority tags anymore. Search engines used to look at them, but now they ignore them.
Types of Sitemaps
There are many types of sitemaps, but here are the ones we actually need to know.
XML Sitemap Index
XML sitemaps have some limits:
- They can only include up to 50,000 URLs.
- The file size can’t be more than 50 MB when unzipped.
Sitemaps can be zipped using gzip to save server space. But when unzipped, the size and URL limit must still be followed. If the limit is passed, we need to split the URLs into several sitemap files.
These files can then be grouped using an XML sitemap index, which is like a sitemap that lists other sitemaps. It’s usually called sitemap-index.xml.
We can create more than one sitemap index file, but we cannot place one sitemap index inside another.
To help search engines find all the sitemaps:
- Submit the sitemap index to tools like Google Search Console and Bing Webmaster Tools.
- Add the sitemap index link to the robots.txt file so search engines know where to look.
Image Sitemap
Image sitemaps were made to help search engines find and index images. In the past, they had special tags just for image data.
Today, it’s better to use something called JSON-LD ImageObject markup. This gives more details about the images than an image sitemap.
Because of that, a separate image sitemap isn’t really needed. Instead, we can just include image tags inside the main XML sitemap using the right image namespace.
Also, the images do not need to be hosted on the same website domain. We can use a CDN, as long as that CDN is verified in Google Search Console.
Video Sitemap
Just like images, video tags can be added directly inside the main sitemap.
But videos have more tag options than images. If we want to use all these tags, it’s better to create a separate video sitemap.
Adding many video tags can make the sitemap very large, which may go over size limits. Either way, these tags help Google find and index our videos, as long as:
- The video is related to the page it’s on.
- Google can access the video.
Bing also supports video sitemaps. But Bing prefers video submissions through IndexNow, even though its help pages still mention mRSS format.
Google News Sitemap
Google News sitemaps are only for news articles published within the past 48 hours. After that, those links should be removed from the sitemap.
While it’s possible to add News tags inside the main sitemap, it’s better not to. Only Google uses the News sitemap tag — Bing and others do not.
Some people think News sitemaps should include image links, but Google News sitemaps do not support image URLs.
HTML Sitemap
XML sitemaps help search engines. HTML sitemaps are made to help people find pages on the website.
But do we still need them?
If the website has clear menus and good internal links, most users can find what they need without an HTML sitemap. We can check this by looking at how often the HTML sitemap page is visited in Google Analytics. If the number is low, users may not be using it.
Many websites add HTML sitemaps in the footer, so it takes a link from every page. But ask — is this the best use of those links?
If users rarely visit it, and search engines don’t need it because of a strong XML sitemap and clear links, the HTML sitemap may not be useful anymore.
XML Sitemap Optimization
Optimizing an XML sitemap means choosing the right structure and adding only the right pages. How we set this up helps search engines crawl our site better, which can improve how our content shows up online.
Here are four easy ways to make sure our XML sitemaps are well-optimized:
1. Only Add SEO-Important Pages
An XML sitemap is a list of pages we want search engines to find and crawl. But not every page on our website needs to be in it.
When a search engine visits our site, it only has a limited time to crawl pages. By using a sitemap, we are telling it which pages matter the most.
So, we should not include these types of pages in our sitemap:
- Pages with 301 redirects.
- Pages that return a 404 or 410 error.
- Pages that are not the main version (non-canonical).
- Pages with a “noindex” tag.
- Pages blocked by robots.txt
- Paginated pages.
- URLs with tracking or filters that don’t help SEO.
- Download pages like whitepapers that need a form.
- Utility pages like login, contact us, or privacy pages.
Some suggest adding broken or redirected pages to help search engines remove them faster, but doing that can make search engines ignore the sitemap altogether. This could harm how well our good pages get crawled.
Also, remember that search engines use the sitemap as a guide, not a rule. Even if a page is not listed in the sitemap, it might still get indexed.
2. Make Sure the Sitemap Is Valid
There are tools that can check if our sitemap code is correct. But just passing those checks is not enough.
Sometimes, search engines like Google or Bing may not be able to reach our sitemap because of block rules or other problems. Most third-party tools won’t show this.
The best way to make sure our sitemap works is to send it directly to Google Search Console and Bing Webmaster Tools. If there is a problem, we will see a red warning. We can click on it, fix the issue, and submit it again.
These tools don’t just check the sitemap, they also give helpful details on how it’s working
3. Use Sitemap Reports To Understand Indexing
Let’s say we send 80,000 pages to search engines using one large sitemap, but 9,000 of them don’t get indexed by Google or Bing.
Sitemap reports can help us find out why so many pages were skipped. However, they don’t always tell us exactly which pages had the problem. So even though this info is useful, it’s not always easy to act on.
To fix this, we can create smaller sitemaps based on parts of our website, like separate sitemaps for categories, products, and blog articles.
This way, if 7,000 out of the 9,000 skipped pages are in the category sitemap, we’ll know where to focus and what to fix.
We can also do this inside a sitemap index file.
Many people follow the example of using numbers in sitemap names, like:
- /products-1.xml
- /products-2.xml
But these names don’t give much detail. Instead, we could name them like this:
- /products-mens.xml
- /products-womens.xml
- /products-kids.xml
If our site is in more than one language, we can also separate sitemaps by language.
This way of organizing helps us find problems faster and makes the data easier to understand.
Just one thing to remember: each page should only be in one sitemap. Google News is the only exception to this rule.
4. Plan the Size of Each Sitemap
Search engines only allow 50,000 URLs in one sitemap. Some SEO experts prefer to keep it even smaller, like 10,000 pages, to help with faster indexing.
But tools like Google Search Console only let us download reports for 1,000 pages at a time. So, if we have 2,000 pages not being indexed, we’ll only see data for half of them.
To fix this, we can break sitemaps into smaller groups of 1,000 URLs. This helps us check and fix all issues.
Yes, this method takes more time to set up. We’ll also need to upload all the sitemaps to Google and Bing and keep them updated. But in the long run, it gives us better control.
Best Tips for XML Sitemaps
- Create sitemaps automatically
- Use compressed sitemap files
- Use a sitemap index
- Add
and tags - Add image tags if there are images
- Add video or news tags if needed
- Mention the sitemap in robots.txt
- Submit to Google and Bing tools
- Only add pages that are good for SEO
- Make sure each page is only in one sitemap
- Fix any errors in the sitemap code
- Group URLs by type using clear names
- Plan how to split big sitemaps
- Use Google and Bing tools to check indexing status
Partner with our Digital Marketing Agency
Ask Engage Coders to create a comprehensive and inclusive digital marketing plan that takes your business to new heights.