WordPress Sitemap

How to Add a WordPress Sitemap and Why it’s Vital

Last Updated on by Michael Brockbank

A sitemap is a very valuable part of any website. It’s the primary method in which search engines use to find your content. While you can still show in sites like Google without one, it makes the process easier and much quicker. How do you go about creating a WordPress sitemap to improve SEO for your site?

For this tutorial, I’ll show you two methods you can use easily. This includes demonstrating Yoast SEO. It’s a flexible tool I use for a variety of purposes, such as creating optimized content and includes a sitemap feature.

Installing a WordPress Sitemap

A sitemap is a file that displays all of your available content. Well, the content you want to share with search engines anyway. Most sitemap plugins for WordPress will create and add to this file automatically, which means you don’t need to do anything except submit the file once to search engines.

Everything else is automated.

Method 1: Using the Built-in WordPress Sitemap

If you don’t have any other XML sitemap plugins installed, the newest version of WordPress comes with a built-in file. It is created as needed, which means you probably won’t actually see the file if you’re looking in your site’s root directory.

The default URL of WordPress 5.5+ XML sitemap is:
http://www.yourwebsite.com/wp-sitemap.xml

However, installing some plugins will remove the file from the WordPress core. For instance, the Yoast SEO plugin will add a line to the functions.php. This coding removes the default WordPress core sitemap.

Add this to your functions.php file:
add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ );

Personally, I’d rather use a more elaborate plugin that offers everything I need in one place. But, feel free to use the built-in WordPress XML sitemap.

Method 2: Using Yoast SEO and Adding a Sitemap

Yoast SEO comes with a variety of tools to help you create an amazing website. It’s one plugin I fully trust and always one of the first I install on any website.

1. Install the Yoast SEO Plugin

Install and activate the Yoast SEO plugin. You’ll find it by searching for “Yoast SEO” when adding new plugins within WordPress.

Yoast SEO Plugin

Click the SEO tool from the left admin panel.

Yoast SEO Tool

2. Configure Yoast and its Sitemap

Click the configuration wizard if this is your first time. This will walk you through the process of optimizing your website. Otherwise, you can skip to the next part.

Yoast Config Wizard

Follow the steps to complete the configuration for your website.

Configure Yoast

If you don’t know all of the information for the wizard, don’t worry. Most of the settings are activated by default and are changeable.

3. Access the WordPress Sitemap for Yoast

As soon as you activate Yoast, the sitemap is created. This file is what you’ll give to search engines like Google.

To access the sitemap, click the Features tab along the top.

Yoast Features

Scroll down and click the question mark next to XML Sitemaps. Depending on your settings, the sitemap button is switched, “On.” If not, click the On button to activate it.

Yoast Sitemap Button

Click the “See the XML sitemap” link.

See Sitemap Link

This will open a new window displaying the content within your WordPress sitemap. The URL in your browser’s address bar is what you want to use when adding your site to Google or Bing.

Sitemap URL

In most cases, WordPress will simply add the file: /sitemap_index.xml. So, you’re sitemap might be located at: http://www.yourwebsite.com/sitemap_index.xml.

What if I get a 404 error or if the sitemap isn’t working?

Sitemap Fail

Sometimes when you add a new tool like Yoast to create sitemaps, it throws out an error that the file doesn’t exist. In this case, you’ll have to troubleshoot a little to find the problem. However, this fix works in every instance I’ve personally witnessed.

Go to Settings and click, Permalinks.

Permalinks

Click the Save Changes button without making any adjustments.

Save Permalinks

This causes the system to rewrite how links work, which in turn affects several types of plugins including Yoast.

Now go back to Yoast and try to open the sitemap link again.

Adding the Sitemap to Google

Before you can add a sitemap to Google, you need to have a verified website in Search Console.

Find your website in Search Console and click its link. If you don’t have one, you’ll need to connect your website to Search Console before you can add a sitemap.

Search Console

Click the “Sitemaps” option on the left. It’s located under the “Index” tab.

Sitemaps

Enter your new sitemap URL and click, “Submit.”

Submit New Sitemap

The only part of the URL you’ll need is anything proceeding your primary website address. For instance, Yoast SEO might create the WordPress sitemap as: http://wwww.yourwebsite.com/sitemap_index.xml. This means you’ll only use the “/sitemap_index.xml” in Search Console.

Will this Affect Search Engine Optimization?

Creating and submitting a WordPress sitemap is perhaps the first step to optimizing your website for search engines. By using the data within these files, systems like Google know where to look to start indexing your content.

Otherwise, they’ll have to wait for links back to your site. Even then, there’s no guarantee the entire site will be visible in search results.

The WordPress sitemap helps engines immensely and should be one of the first things you add when creating a new website. The sooner Google can index your content, the sooner traffic will come flowing in.

Alternatives to Yoast SEO

Yoast, although an excellent tool, isn’t the only way to add a WordPress sitemap. In fact, there are plenty of plugins to choose from. Personally, I prefer Yoast as it comes with a variety of tools to help build a site.

Here are a few you might want to consider.

Jetpack

Jetpack

From the same creators of WordPress itself, Jetpack is another one of my favorite tools. This plugin comes with a myriad of modules to help create a great website including a sitemap generator for WordPress. The only downside is you need to register an account with WordPress.com, which is free.

Besides, the features you get from WordPress.com are worth it in my opinion. While I don’t use it for WordPress sitemaps, I do use it for visitor tracking, sharing, and a few other facets of my sites.

Google XML Sitemaps

Google XML Sitemaps

A very common title among WordPress users, Google XML Sitemaps is an exceptionally popular generator for WordPress. It has more than two million active installations and comes with a few useful features. You can fine-tune exactly what is shared with search engines such as adding the file to robots.txt and when to notify search engines of new content. It’s quick and easy while giving you immediate access to the XML file itself.

This is the plugin I used until I stumbled across Yoast.

Sitemap by BestWebSoft

BestWebSoft

The plugin, Sitemap by BestWebSoft, is another semi-popular plugin that allows easy editing for the file. You can easily add pages, posts, categories, tags, custom post types, and other custom taxonomies.

It also automatically sets up the media sitemap and adds the path from your robots.txt file.

Getting the Most Out of Your Site

There’s no doubt that a WordPress sitemap is going to greatly benefit you in terms of pulling in traffic. It’s the primary method of how people are going to find your content. Even if you plan on just hosting a blog or a portfolio, it doesn’t hurt to have search engines crawl your site as often as possible.

You never know who will be interested in your content.

Michael Brockbank
Follow Me...

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments