📘 You're Losing Customers

📘 You're Losing Customers

building an xml sitemap

How to Build an XML Sitemap for SEO

  • November 28, 2019

About the author

Ryan Stewart

I have an unhealthy obsession with being considered the world's BEST internet marketer. I'm highly active on social media and love a good debate.

SEO success on today’s web requires technical excellence – that begins with optimizing your XML Sitemap.

XML Sitemaps help search engines crawl and understand your website’s content, structure and priorities.

Your sitemap is a good place to begin to ensure Google’s discovering all your pages.

Building XML sitemaps can be a little daunting but despite how they look, you don’t need a developer to create one.

XML sitemap example

This post will cover how you can improve your SEO by building proper XML sitemaps.


Your Website is Losing Money...

Find out exactly how many customers you SHOULD be getting from organic search.


There’s 2 ways to create a sitemap…

  1. Manual implementation. This is best for sites that aren’t built on a CMS platform (like WordPress and Magento). You’ll need to download an XML format of your entire site content and then upload it into your root folder. Afterwards, you generate a URL for it and submit it to Google. You’ll learn more about this as you read along.
  2. Plugin-based implementation. If you’ve built your site on using a CMS, you can find a sitemap generator plugin, properly install and activate it, and then set it to include the pages you want search engines to crawl and index.

We’ll discuss how to do both.

1. How to build a sitemap manually

Why spend the effort to manually build a sitemap?

For two key reasons:

  1. If your website doesn’t run on a CMS that supports a sitemap generator, then you’ll have no choice but to build it manually.
  2. Building a sitemap from the ground up forces you to review other key SEO factors like your website’s UX and architecture.


First, we need to layout your sitemap, visually

For a small site, you can use a whiteboard, paper or PPT.

When mapped out, it could look something like this:

visual sitemap layouts

Image source

In general, you need to link to your core pages from your homepage — or at least from a page that’s linked to from your homepage. Ideally, visitors shouldn’t have to click more three links from your homepage to reach any of your core pages.

For larger sites, you need a deeper strategy.

  • Leverage software to create a visual sitemap of your site’s inventory (Dynomapper)
  • Run a content audit to fully understand the performance of your website’s pages
  • Review your site’s UX, potentially going through the process of rebuilding your website’s architecture

Yes, these are time consuming tasks but your site’s architecture is critical for Google to properly crawl your site. It’s worth the investment of resources to get this done.


Second, create your sitemap in an XML file

Building a sitemap manually doesn’t mean you have to it from scratch.

We’ll generate it using a tool — then upload it into your root folder.

A sitemap generator (i.e. Sitemap Writer Pro) will extract your URLs and put them into an XML sitemap file.

Before extracting the sitemap file, you can add, delete, and edit URLs based on what you want search engines to crawl.

site crawler

Once you’re done setting up your URLs, you can then upload them into your root folder, with /sitemap.xml as its label.

You’ll need access to your website’s Cpanel to upload your Sitemap. If you aren’t comfortable maneuvering here, we suggest using a developer.

With your XML file, we can submit them to search engines for processing.


Third, submit the XML file to search engines

Once uploaded to your Cpanel, your sitemap should now be visible at yourdomain.com/sitemap.xml.

You’ll want to submit your Sitemap to Bing and Google. Let’s use Google as the example.

  • Go to Google Search Console
  • Locate the Sitemaps tab at the left sidebar
  • Enter your sitemap URL extension (/sitemap.xml) in the bar provided and click Submit

google search console sitemap

Once you click Submit, check the Status column and see whether your sitemap submission failed or succeeded.

If you need to remove a sitemap, click the three-dot navigation keys in upper right of your screen – you’ll have the option to remove.

gsc 2

If your website runs on a CMS like WordPress of Shopify, we can partially automate this process.

2. How to create sitemaps automatically via plugin

If you’re using WordPress, for instance, plugins like Yoast SEO and Google XML sitemap are suitable.

While building a sitemap with a plugin helps, there’s still a level of optimization needed.

Let’s use Yoast SEO for here for demonstration purposes.

Essentially, besides its ability to help you generate sitemaps, Yoast is a plugin that helps you control your search appearance and rankings. Once installed in your CMS, Yoast becomes the “SEO” tab you see on the left sidebar of your screen:

yoast optimization

Under the SEO tab, the plugin displays seven subtabs — one of which is Search Appearance. Navigate here to activate and manage your sitemap.

Under Search Appearance, click Content Types — the setting that allows you to add and remove the pages you want to add in your sitemap; that is, pages you want search engines to crawl.

Here, you’ll see at least two tabs for your posts and pages:

yoast sitemap wordpress

Once you click any of these tabs, you get a dropdown of the elements that you want to appear when search engines display your blog posts in search results. Here’s how it looks:

sitemap setup

Switch the buttons according to how you want your web pages and content to appear in search results.

In the screenshot above:

  • Posts are set to show in search results
  • Dates are set to hide in snippet preview; here’s how that looks:


  • And Meta Box (description) are set to show as well, meaning the descriptions of all your posts will appear in search results.

3. Adding on video and image sitemaps

Chances are high you have content formats besides text-based content — videos and images — on your site. You can make them crawlable for search engines in the same way your text-based pages are crawled and indexed.

Here are the scripts to use in your image and video sitemaps and guidelines on how to properly use them to describe your visuals to search engines:


Video sitemap

<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″
<image:caption>Dogs playing poker</image:caption>
http://www.example.com/video123 . flv
<video:player_loc allow_embed=”yes” autoplay=”ap=1″>
<video:title>Grilling steaks for summer</video:title>
Cook the perfect steak every time.


Video sitemap guidelines

 Tag Required? Description
<loc> Yes This tag specifies the landing page (aka play page, referrer page) for the video. When a user clicks on a video result on a search results page, they will be sent to this landing page. Must be a unique URL.
<video:video> Yes Encloses all information about the video.
<video:thumbnail_loc> Yes A URL pointing to the video thumbnail image file. Images must be at least 160×90 pixels and at most 1920×1080 pixels. Recommend  images in .jpg, .png, or. gif formats.
<video:title> Yes The title of the video. Maximum 100 characters. All HTML entities should be escaped or wrapped in a CDATA block.
<video:description> Yes The description of the video. Maximum 2048 characters. All HTML entities should be escaped or wrapped in a CDATA block.
<video:duration> Recommended The duration of the video in seconds. Value must be between 0 and 28800 (8 hours).


Image sitemap example

<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″


Image sitemap guidelines

 Tag Required? Description
<image:image> Yes Encloses all information about a single image. Each <url> tag can contain up to 1,000 <image:image> tags.
<image:loc> Yes The URL of the image.
<image:caption> Optional The caption of the image.
<image:geo_location> Optional The geographic location of the image. For example,

<image:geo_location>Limerick, Ireland</image:geo_location>

<image:title> Optional The title of the image.
<image:license> Optional A URL to the license of the image.

Need more?

Sitemaps are an important part of the SEO process, but there’s so much more.

Leave a Comment

Your email address will not be published. Required fields are marked *

Comments ( 66 )

  • Linda Says
    3 years ago

    It took a while to understand the points mentioned in the article. Good stuff. I really appreciate the
    hardwork behind this article. Thanks & Keep up the good work!


    Find out how much organic traffic your website should be getting through our Traffic Projection Analysis.




    Using data from your website, our Traffic Projection analysis can accurately forecast how much traffic (and revenue) your website could be getting from Google.