Here to LEARN? Check out The Blueprint Training

Learn SEO from the best

Let’s Go

STEAL OUR PROVEN

SEO BLUEPRINT


Video training series detailing how we took a client from 3k to 100k organic visits in 8 months.

SHOW ME!

How to Build an XML Sitemap for SEO

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.

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:

serps

  • 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″
xmlns:image=”http://www.google.com/schemas/sitemap-image/1.1″
xmlns:video=”http://www.google.com/schemas/sitemap-video/1.1″>
<url>
<loc>http://www.example.com/foo.html</loc>
<image:image>
<image:loc>http://example.com/image.jpg</image:loc>
<image:caption>Dogs playing poker</image:caption>
</image:image>
<video:video>
<video:content_loc>
http://www.example.com/video123 . flv
</video:content_loc>
<video:player_loc allow_embed=”yes” autoplay=”ap=1″>
http://www.example.com/videoplayer.swf?video=123
</video:player_loc>
<video:thumbnail_loc>
http://www.example.com/thumbs/123.jpg
</video:thumbnail_loc>
<video:title>Grilling steaks for summer</video:title>
<video:description>
Cook the perfect steak every time.
</video:description>
</video:video>
</url>
</urlset>

 

Video sitemap guidelines

 TagRequired?Description
<loc>YesThis 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>YesEncloses all information about the video.
<video:thumbnail_loc>YesA 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>YesThe title of the video. Maximum 100 characters. All HTML entities should be escaped or wrapped in a CDATA block.
<video:description>YesThe description of the video. Maximum 2048 characters. All HTML entities should be escaped or wrapped in a CDATA block.
<video:duration>RecommendedThe 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″
xmlns:image=”http://www.google.com/schemas/sitemap-image/1.1″>
<url>
<loc>http://example.com/sample.html</loc>
<image:image>
<image:loc>http://example.com/image.jpg</image:loc>
</image:image>
<image:image>
<image:loc>http://example.com/photo.jpg</image:loc>
</image:image>
</url>
</urlset>

 

Image sitemap guidelines

 TagRequired?Description
<image:image>YesEncloses all information about a single image. Each <url> tag can contain up to 1,000 <image:image> tags.
<image:loc>YesThe URL of the image.
<image:caption>OptionalThe caption of the image.
<image:geo_location>OptionalThe geographic location of the image. For example,

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

<image:title>OptionalThe title of the image.
<image:license>OptionalA URL to the license of the image.

Need more?

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

Want more traffic?

Find out how we can get your website performance.

Schedule Consult

Comments

Leave a Comment

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