WordPress Sitemap: What It Is and How to Create One

WordPress Sitemap: What It Is and How to Create One

Creating a WordPress sitemap is one of the many ways to optimize a website. By using a WordPress sitemap, website visitors and search engine bots can see the structure of a site better. WordPress sitemaps create a better user experience for visitors and provide accurate information for search engines to crawl.

This article will provide more details on the benefits of generating sitemaps for WordPress websites. We will also explain the differences between an XML and HTML sitemap and how both of them help optimize a site.

In addition, you will learn how to generate both sitemaps for your WordPress site and submit a sitemap to Google and Bing.

Without further ado, let’s get started.

What Is a WordPress Sitemap and Why Do You Need It?

A WordPress sitemap is a list of all the public URLs on a WordPress website. Sitemaps help visitors and search engines navigate through all of the URLs in a site faster and easier. They can also show the relationship between different pages and the importance of each page. Read our guide if you want to learn more about what is sitemap in general.

A WordPress sitemap helps website owners by:

  • Notifying search engines – alerts search engine crawlers and shows visitors when there are new posts on a website. WordPress sitemaps also inform search engines about pages on a site that they have not indexed before.
  • Easy navigation – shows the structure and hierarchy of web pages by providing a complete list of custom URLs.
  • Search engine optimization – helps optimize a website by notifying search engines that the website does not have duplicate content. Sitemaps also make a website more user-friendly, which improves its ranking on search engine page results (SERPs).

Differences Between an XML and HTML WordPress Sitemap

There are two different types of WordPress sitemap: an XML sitemap and an HTML sitemap. Each type plays a significant role in optimizing a website in its own different ways.

When submitting a WordPress sitemap to search engines, use an Extensible Markup Language (XML) sitemap. With this language, search engine bots will find content and information easier. XML sitemaps also provide additional metadata and context of each URL.

Meanwhile, HTML sitemaps provide links representing all web pages using HTML format. This functionality presents all public pages on a site in a more user-friendly way, making it easier to navigate.

The main difference between the two sitemaps is that an XML sitemap is located in a separate URL and focuses on search engines. Meanwhile, an HTML sitemap can be included in the web pages for website visitors.

We recommend having both WordPress sitemaps to guarantee an optimal user experience, which will increase your search engine ranking as a result.

How to Generate a WordPress XML Sitemap Manually?

Generating a WordPress XML sitemap manually will help to specify the exact information search engine crawlers will learn. However, it will take more time to create a WordPress sitemap manually, especially for websites with more than 10 URLs.

To create WordPress sitemaps manually, open a text editor, such as Windows Notepad, or Nano for Linux and macOS users. Keep note that the file needs to be in XML format. In it, include the URL of your website, and all the necessary information search engines should know.

Here is an example of an XML sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
      <loc>http://www.example.com/</loc>
      <lastmod>2021-07-18</lastmod>
      <changefreq>monthly</changefreq>
      <priority>0.5</priority>
   </url>
</urlset>

In this sitemap, there are both required and optional tags. Below is an explanation of the required tags:

  • <urlset> – reference the current protocol standard. Keep the URL in the example for your XML sitemap file.
  • <url> – parent tag for the URL. The rest of the tags are included inside this tag.
  • <loc> – URL of the website. It must start with the protocol, such as HTTP, and end with a trailing slash if your web server uses it. The value for this tag must be under 2,048 characters.

In addition, some of the optional tags to consider are:

  • <lastmod> – shows the last modification time of the website. Use the YYYY-MM-DD format for this tag.
  • <changefreq> – reveals how frequently the website makes changes. The valid values are: always, hourly, daily, weekly, monthly, yearly, and never.
  • <priority> – let search engines know which URLs are most important for the crawlers. The valid values range from 0.0 to 1.0, with the default 0.5.

Once you have created an XML sitemap file, upload it to your WordPress root folder. Then, access the sitemap URL to check the WordPress sitemap. Usually, the URL follows this format:

http://example.com/sitemap.xml

After finding the sitemap URL, validate it with the sitemap validator. Invalid sitemap files might hamper WordPress websites. So, it is essential to check first with a validator before submitting XML sitemaps to search engines.

To use the sitemap validator, enter the sitemap URL on the validator and click on the VALIDATE SITEMAP button.

Clicking Validate Sitemap in the XML Sitemap Validator.

If the WordPress sitemap is valid, it will show a No issues detected banner.

The XML validation results window informing that no issues were detected.

However, if the WordPress sitemap is invalid, it will show a Problem detected warning message.

The XML validation results window informing that a problem was detected.

How to Generate a WordPress XML Sitemap Using a Plugin?

To automatically create a sitemap in WordPress, use sitemap plugins. It is a faster and more reliable way to generate a WordPress sitemap.

By installing a WordPress plugin, users will receive additional features and functionalities to help optimize their website. The plugins also help to update WordPress sitemaps when any changes are made automatically.

Below you’ll find guides on how to generate a WordPress XML sitemap with two of the best WordPress plugins for the job.

Generate a WordPress Sitemap Using Yoast SEO

Yoast plugin is one of the most popular SEO plugins for WordPress. This SEO plugin takes care of all the technical aspects related to optimizing WordPress content, including the creation of XML sitemaps.

Follow these steps to create your own WordPress sitemap:

  1. Head to WordPress Dashboard -> Plugins -> Add New and look for the Yoast SEO plugin. Click on Install Now and Activate the plugin’s free version.
Clicking on the Install Now button to get the Yoast SEO plugin.
  1. Go to the SEO menu on the dashboard, and select General. Then, enter the Features tab to see the settings.
Enetering the Features tab in the General settings of Yoast SEO.
  1. Under the features tab, select the On button below XML sitemaps and click on the Save changes button.
Selecting On below the XML sitemaps and clicking on the save changes button.
  1. To check the XML sitemap link, click on the question mark icon and select the See the XML Sitemap option.
Clicking on the question mark icon to check the XML sitemap link,
  1. Yoast SEO will redirect you to the XML sitemap URL. There, you will see more information about each URL on your site.
More information about each XML sitemap's URL,

In addition, Yoast SEO has the Webmaster Tools setting which can connect a WordPress website to different search engines right away. By doing so, it will be easier to submit and notify of updates to various search engines.

Clicking on the Webmaster Tools tab in the general settings of the Yoast SEO plugin,

Google XML Sitemaps

The Google XML Sitemaps plugin is great for those who prefer advanced sitemap settings and the option to submit one to search engines right away.

Another notable XML sitemap feature is its automatic notifications to major search engines when new content is posted or published. Follow the steps below to use the plugin:

  1. Install the XML Sitemaps plugin from the WordPress plugin directory.
Clicking on the Install Now button to get the XML Sitemaps plugin,
  1. Open the configuration page by going to Settings -> XML-Sitemap. As the plugin automatically generates an XML sitemap for a WordPress site, you will see the sitemap URL there.
Going to the XML Sitemaps plugin's setting to see the sitemap URL,
  1. Click on the URL to see the XML Sitemap Index.
The XML Sitemap Index,

To notify search engines, head to Settings -> XML-Sitemap and find the Basic Options section. Check off the first two boxes to notify both Google and Bing and click on the Update options button at the bottom of the page.

The Basic Options section where we check off the first two boxes,

How to Submit a WordPress XML Sitemap to Search Engines?

After generating a WordPress sitemap, submit it to search engines like Google and Bing to get indexed. Note that while search engines will still crawl websites without manual submission, submitting WordPress XML sitemaps to search engines will still provide additional benefits:

  • SEO – sitemaps notify search engines when there are changes or new content, which helps your page remain updated in the search engine results.
  • Accuracy – with the help of a WordPress sitemap, a search engine will only index the most accurate and relevant information of a site.
  • Free – there is no cost to generate a WordPress sitemap, no matter the method.
  • Organic traffic – generate more visits by ranking higher on SERPs.

Before submitting a WordPress site to search engines, you need an XML sitemap URL.

Submit an XML Sitemap to Google

Submitting a WordPress sitemap to Google will drive higher traffic and increase awareness of a website. Website owners can do so by using Google Search Console.

Log into your Google account and follow the steps below:

  1. Select the property type to start. To get information on all URLs across the domain, select the Domain option. Enter your domain name and click on the CONTINUE button.
The Welcome to Google Search Console window where we select the Domain option.
  1. Verify the domain by adding the TXT record from the Google Search Console to your domain name system (DNS) server. With Hostinger, head to hPanel -> DNS Zone Editor and add the record under the Manage DNS records box.
Screenshot from DNS Zone Editor showing where to add record.
  1. Head back to the Google Search Console account and select Sitemaps on the left sidebar menu. There, insert your sitemap URL under the Add a new sitemap section and click SUBMIT to finalize the process.
Screenshot from Google Search Console showing where to add a new sitemap.

To check the status, head to Sitemaps -> Submitted sitemaps. Google Search Console will share the status and give feedback on optimizing your site using documentation and resources.

Submit a WordPress XML Sitemap to Bing

Bing is another popular search engine to submit a website to since other search engines, such as Yahoo and DuckDuckGo, also use its search index for rankings. Website owners can use the Bing Webmaster Tools for immediate crawling and indexing.

Follow the steps below to submit WordPress XML sitemaps to Bing:

  1. Use Microsoft, Google, or Facebook accounts to sign in to Bing Webmaster Tools.
Choosing an account to sign in to Bing Webmaster Tools
  1. Under the Add your site manually section, add your website’s URL. If the URL has been verified on Google Search Console, sign in using your Google account and click the Import button.
Welcome to Bing Webmaster Tools window where we click on the import button,
  1. Select Sitemaps -> Submit Sitemaps and add the sitemap URL to notify the tool to index your site.
Clicking on the Submit sitemap button.

To explore the status of the indexing, click Site Explorer on the left sidebar menu.

How to Create an HTML Sitemap Page for WordPress?

As mentioned before, the WordPress HTML sitemap is an essential part of SEO. It provides user-friendly navigation for website visitors and establishes a clear structure for the web pages.

The easiest way to create an HTML sitemap for a WordPress site is by installing a plugin. We recommend using the WP Sitemap Page:

  1. Install WP Sitemap Page and activate the plugin.
Clicking on the Install Now button to get the WP Sitemap Page plugin.
  1. Head to Dashboard -> Pages -> Add New to create a new page on a WordPress site. To add the WordPress sitemap to an existing page, select the page under the Pages section. That said, we do recommend creating a new page instead.
Screenshot from the WordPress dashboard showing where to find Pages in the menu and click on Add New.
  1. Insert the following shortcode to add the HTML sitemap:

[wp_sitemap_page]

Inserting the shortcode to add the HTML sitemap.
  1. Click Publish, and the WordPress HTML sitemap will be available on your website.
How the HTML sitemap looks on a website.

Conclusion

This article has shared two different ways to generate WordPress sitemaps: manually and by using plugins. If you choose to do so manually, you will be able to choose the exact information to include in your sitemap. However, doing so takes more effort and involves an extra step of using a validator tool to test your sitemap.

Instead, we recommend using one of the plugins to create both the HTML and XML sitemaps. We have also shared the steps to submit a WordPress sitemap to Google and Bing.

Don’t hesitate to share your experience in generating and submitting a WordPress sitemap in the comment section below.

Author
The author

Domantas G.

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.