skip to Main Content

How to set up HTML and XML sitemaps in WordPress

I recently spoke at a WordPress event and after my talk, I opened the floor for questions. One of the attendees asked how I feel about sitemaps, and if they can help with SEO.  It was a great question! In this post, I’ll share here what I shared at the event. In short, I’ll cover how you can set up HTML and XML sitemaps, respectively, in WordPress.

I’ll spend some time covering all things HTML sitemaps, and then a little further down in the article, I’ll switch over to XML sitemaps. Let’s dive in!

What HTML sitemaps are, how they work, and how they help

An HTML sitemap is a webpage on a website that provides a hyperlinked outline of all pages on a site. An HTML sitemap can be helpful for users who may be struggling to find their way around a website. The idea is that by presenting an outline of pages on the website, a user might be able to follow the outline and find the desired page. While I once considered an HTML sitemap a popular tool, I don’t see too many websites using them on today’s web.

If a website has good navigation, why would you need an HTML website? That’s a fair question. Generally speaking, you should be able to easily get around a website if the navigation has been built correctly and with users in mind. However, on some websites, typically larger ones, navigation might still be challenging. I feel like an HTML sitemap can help in these scenarios (however, I personally haven’t used HTML sitemaps like this for a long, long time).

How to add an HTML sitemap to your WordPress website

You can manually build a page for your HTML sitemap, or you could take the approach most will take: Use a WordPress plugin. Most people will go with a plugin solution because of its ease of deployment, so let’s explore how that would work.

There are a lot of WordPress HTML sitemap plugins out on the web. Make sure you’re only using plugins on the WordPress plugin repository.

We really like WP Sitemap Page, but there are other plugins out there. Find one that works for you. Keep in mind, you may need to adjust settings to get the desired experience with your HTML sitemap. To set up this plugin, just follow the Installation steps on the plugin page.

Now I’m going to switch over to XML sitemaps!

What XML sitemaps are, how they work, and how they help

An XML sitemap is a collection of all of the pages you’d like search engines to crawl and index, listed in an XML file. XML sitemaps can be generated from time to time using an XML sitemap generator, or, if you’re using a WordPress plugin like Yoast or All in One SEO Pack, you can turn on the auto-generate function and let the plugin do the work for you, automatically. When you turn on the auto-generated XML sitemap, the file is then created and stored on your server.

Differences between HTML sitemaps and XML sitemaps

One of the questions you might have thought about: What’s the difference between an HTML sitemap and an XML sitemap? It’s a great question and I’ll try to explain the differences. An HTML sitemap is a page on a site where its sole purpose is to deliver a structured outline of all pages on that site. It’s a page solely designed for users, so they can find the page they’re trying to get to and go to it.

XML sitemaps are helpful for search engines, because they give crawlers a hint, or nudge, to what content is important to you, what pages you consider to be visit-worthy,  and what you’d like to see them crawl and index. However, XML sitemaps aren’t user-friendly.

Take a look at our XML sitemap at the time of this article’s publishing (October 2019), and you’ll see what I mean:

Expander Digital's XML sitemap

This isn’t very helpful for users, because it’s not user-friendly. However, the XML sitemaps listed within the main XML sitemap (as seen above) can help search engines discover new content or content changes on your website and could help get those changes reflected in search.

What pages or content types should be included in your XML sitemap

This is a tough question to answer across the board. Every website is different, so it makes sense that what should be included in an XML sitemap will be different for every website. Think about the different content types on your website, and whether or not users will find value when they land on those pages. If those pages should show up in search, because they provide value, then they probably should be included in the XML sitemap.

Having said all of the above, sometimes it helps to have a starting point. For most WordPress websites, pages and posts should be included in the XML sitemap. This means your home page, your landing pages, and other pages will be included in the XML sitemap and pages will be crawled and indexed by search engines like Google. Posts will also be included, so this means your blog articles will show up in search.

At the end of the day, it’s really up to you which pages, posts, or content types should be included in your XML sitemap.

How to set up an XML sitemap with Yoast

Yoast makes it very easy to set up an XML sitemap.

Just follow these steps:

  1. Log in to WordPress.
  2. From the left menu, go to SEO > General.
  3. Select the Features tab.
  4. Toggle the XML sitemaps switch so it’s set to On.

To exclude specific content types from your XML sitemap, follow these steps:

  1. Log in to WordPress.
  2. From the left menu, go to SEO > Search appearance.
  3. Select the Content types tab.
  4. Select a content type like Posts, Pages, or another content type.
  5. Select the Yes or No option under Show in search results? for each content type. If set to No, that content type will not be included in the XML sitemap.
    Posts content type in Yoast
  6. Select the Save changes button.

How to set up an XML sitemap with the All in One SEO Pack

Creating an XML Sitemap with the All in One SEO Pack is also pretty easy:

  1. Log in to WordPress.
  2. From the left menu, select All in One SEO.
  3. Select Feature Manager.
  4. Under the XML Sitemaps card, select the Activate button. You’re all set!

To exclude specific content types from your XML sitemap, follow these steps:

  1. Log in to WordPress.
  2. From the left menu, select All in One SEO.
  3. Select XML Sitemap.
  4. From XML Sitemap panel, you can check or uncheck Post types or Taxonomies. Unchecked items will be excluded from the XML sitemap.
  5. Select the Update sitemap button once you’re all set.

One last thing

To close out this article, I wanted to share a tip that I think often gets overlooked. That tip is this: I  strongly recommend adding the URL of your XML sitemap to your robots.txt file. Why? While Google and Bing (respectively) let you submit your XML sitemap, they aren’t the only search engines on the web. Got it, but how do I add the sitemap URL to my robots.txt file? Glad you asked. We actually have an article on optimizing your robots.txt that walks you through those steps.

Wrap up

HTML sitemaps and XML sitemaps are helpful UX and SEO tools. If we helped you better understand how they work and why they’re important, make sure you regularly check our blog for more articles.

Josh Gellock

Josh is the SEO and Content Strategist at Expander Digital, an SEO studio he founded in 2014. He's been in the SEO space for over seven years and helps businesses drive website traffic from organic search. When he’s not meeting with clients, you can find Josh spending time with his children or on a bike.

This Post Has 0 Comments

Leave a Reply

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

Back To Top