Sep 03, 2021
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:
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.
If the WordPress sitemap is valid, it will show a No issues detected banner.
However, if the WordPress sitemap is invalid, it will show a Problem detected warning message.
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:
- 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.
- Go to the SEO menu on the dashboard, and select General. Then, enter the Features tab to see the settings.
- Under the features tab, select the On button below XML sitemaps and click on the Save changes button.
- To check the XML sitemap link, click on the question mark icon and select the See the XML Sitemap option.
- Yoast SEO will redirect you to the XML sitemap URL. There, you will see more information about each URL on your site.
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.
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:
- Install the XML Sitemaps plugin from the WordPress plugin directory.
- 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.
- Click on the URL to see 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.
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
Log into your Google account and follow the steps below:
- 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.
- 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.
- 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.
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:
- Use Microsoft, Google, or Facebook accounts to sign in to Bing Webmaster Tools.
- 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.
- Select Sitemaps -> Submit Sitemaps and add the sitemap URL to notify the tool to index your site.
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:
- Install WP Sitemap Page and activate the plugin.
- 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.
- Insert the following shortcode to add the HTML sitemap:
- Click Publish, and the WordPress HTML sitemap will be available on your website.
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.