How to Generate a Sitemap for Your Wordpress Blog

Page content

How to Create a Sitemap for Your Wordpress Website

A sitemap is an integral part of your Wordpress seo which includes all the site urls that need to be crawled and indexed. It means it does not include the urls marked as no-index. Every website must have a sitemap whether a wordpress site or another since it makes it easier for Google to crawl and index the right urls.

Creating a sitemap for your Wordpress site is easy and relatively straightforward using a plugin. In this post, we will discuss some of the most common SEO plugins used for creating a sitemap for your Wordpress site as well as a few dedicated Sitemap plugins. However, you can manually create a sitemap if your blog is new with a few or a dozen urls. There are also some online tools to help you create a sitemap and upload it to your blog if you don’t like using a plugin generated sitemap.

The XML sitemaps are meant to be consumed by search engines. If you want to create a sitemap for your users, you can create an html sitemap and add it to a static page on your website. This will help users check out the content on your website and go to a post directly. A link to the html sitemap can also be included in the footer to make it easier for your visitors to check out website content.

XML SItemap using an SEO PLugin:

Since an XML sitemap has a critical role in site SEO, all the leading SEO plugins include it as a built in and free feature. Some plugins also include the feature to add an html sitemap to your website in either the free or pro version. Setting a sitemap for your wordpress blog is generally easy and all that you need to do is to adjust the configurations and the SEO plugin will automatically generate a sitemap for your blog and ping it to search engines, whenever a url is updated or added.

Sitemap Settings with Yoast:

Yoast Sitemap

Yoast is perhaps the most used SEO plugin with the XML sitemap feature included in its free version. If you are using or planning to use Yoast as the SEO plugin for your website, you can easily generate an XML sitemap and submit it to Google search console.

Install the Yoast SEO Plugin just like you install any plugin. Go to the wordpress plugin repository and search for Yoast. Then, install and activate the plugin. Now, visit the settings page and check out the site features section. Scroll down until you find the XML sitemaps. Toggle the XML Sitemaps button to activate this feature for your blog. If you do not switch on this feature, Yoast will not generate a sitemap for your blog.

Once you have activated the XML sitemaps feature, you can check out the live sitemap for your website by clicking on ‘View the XML sitemap’. Please note that, the sitemap will include only the urls which you have set as to be indexed and not the ones that are set to noindex. If you have set categories and tags as noindex, they will not be included in the Yoast generated sitemap. For a basic blog, you will need your post urls and static page urls in the sitemap.

You can check out the sitemap generated by Yoast by appending sitemap_index.xml to your site url.

XML Sitemap using the Rank Math SEO Plugin :

Rank Math Sitemap

Like every leading SEO plugin, Rank Math also generates an XML sitemap for your Wordpress blog. Go to the plugin repository and search for Rank Math. Install and activate the plugin. Following activation, you can check out the plugin settings on the Wordpress dashboard in the left sidebar.

Click on Rank Math SEO to expand its settings and then click on Sitemap settings. Please go to the general settings in sitemap settings and fill the number of urls you want to be included on a single page in the sitemap. If it is a new blog, you can set it at 1000 and save.

The Rank math sitemap settings also include a feature to include or exclude images in sitemap. At the bottom among the general settings, you will find the option to ping search engines. Please, toggle it on since you want Rank Math to notify the search engines whenever a url is updated or a new post is added to your blog.

Right under the general sitemap settings in Rank math, there are the settings for creating and publishing an html sitemap. Use this feature if you want to publish an html sitemap for your users. Create a static page and name it sitemap. Now, add this page to the dropdown menu in the html sitemap section of Rank Math and your task is done. Rank Math will automatically include the selected urls in the html sitemap also.

To exclude particular urls and archives from the sitemap in Rank Math, there are additional settings. On the left side, click on categories and tags and you can include or exclude them from the sitemap using the toggle button.

This is how you can easily generate and publish a sitemap using the Rank Math SEO plugin. Rank Math has been gaining popularity rapidly as an SEO plugin. Apart from its XML and html sitemaps, you will also find its instant indexing API (included with the free version) useful.

Sitemap in Wordpress using SEOpress

SEOpress sitemap settings Enable Sitemap SEOpress

SEOpress sitemap

SEOpress is another impressive SEO plugin, which includes a plethora of features that will make SEO simple and straightforward for you. The wordpress plugin comes in both free and premium versions and is relatively cheaper compared to Yoast.

Like Rank Math, SEOpress also includes both XML and html sitemaps as well as instant indexing in its free version. Install and activate the SEOpress plugin from the Wordpress plugin repository.

Following the activation of the plugin, its settings become visible in the Wordpress dashboard in the left sidebar under the Wordpress settings. Click on ‘dashboard’ in the SEOPress settings and toggle the switch for XML and Html sitemaps on to enable the sitemaps feature. You can configure these features from the xml and html sitemap settings in the SEOpress dashboard.

Click on the XML and Html Sitemap button and then enable the XML and Html sitemaps for your website. The html sitemap can be useful for your website visitors, which you can enable on a static page using shortcode or Gutenberg block. The xml sitemap is meant to be consumed by the search engines. Click on save changes and then in the same section, you can visit the sitemap settings for taxonomies and post types and change the configurations individually. Click on the post types button and include the posts and static pages in the sitemap. You can exclude attachment pages for your blog from being included in the sitemap. At the bottom, you will find the html sitemap settings, where you can copy the shortcode from.

The link to your wordpress xml sitemap can be found in the general settings for XML and Html sitemap at the top.

XML sitemap using AIOSEO plugin

AIOSEO sitemap

AIOSEO is another leading and well known SEO plugin with more than 3 million active installations and which offers a sitemap feature with its free version. You can easily create a sitemap using the plugins and submit it to the search engines.

You can install the plugin like you install any plugin from the Wordpress repository and then activate it. Following the plugin’s activation, you will be able to find all the settings in the sidebar to configure various features including sitemaps. Click on sitemap from among the AIOSEO settings on your wordpress dashboard.

The free version of AIOSEO includes XML sitemap and html sitemap whereas the pro version includes video sitemap and news sitemap also for your blog. However, the free version has sufficient features for a simple blog.

After clicking on sitemap, you will first land on the general setting page from where you can enable the sitemap and then select the types of urls that you want included in the sitemap. While all post types must be included in the sitemap, you can include or exclude the taxonomies (categories and tags generally do not have to be included in the xml sitemap). Additional features in the XML sitemap section include the feature to enable or disable the date archive sitemap and author sitemap. In the advanced settings for the XML sitemap, you can exclude or include images in your sitemap and also set priority score for the post types. The default advanced settings are generally fine.

If you want to enable an html sitemap for your users, this feature is also included with the free version of AIOSEO. Just enable the html sitemap by clicking on the html sitemap button at the top and the switching on the toggle button. Now, you can include an html sitemap on your website in the form of a static page or with the help of a shortcode, as a widget or using a block.

Create a sitemap with the help of The SEO Framework

SEO Framework sitemap

The SEO framework is a very simple and lightweight SEO plugin which has most of the SEO features preconfigured. Setting this SEO plugin, which despite being simple, has all the essential SEO features is very simple.

One excellent thing about this plugin, is that if you are using it for SEO on your website, you can go with the preset configurations. For example, you will hardly need to make any changes to the sitemap section to output a well optimized sitemap for your blog. All the settings in the SEO Framework are found on the same page. Install and activate the plugin and subsequently scroll down until you have reached the sitemap section.

All the features that you require to generate an XML sitemap are already enabled in this plugin. In the general settings for the sitemap, you will find the XML sitemap enabled with default 1000 urls per page. Click on metadata. The plugin adds last modified to urls. You can leave the feature enabled. If you click on the ping button, you will find the feature to notify search engines enabled.

So, generating a sitemap with the SEO framework is as easy as setting the plugin, which means you can just install and activate the plugin and forget it.

We have discussed five excellent SEO plugins, which can help you generate an attractive and well optimized xml sitemap for your blog. If you are using any of them on your blog, then you might already be having a sitemap active on your blog.

Sitemap using a dedicated xml sitemap generator

If for some reason, your SEO plugin fails to generate the xml sitemap or you want to use a different plugin, you can use a dedicated plugin like ‘XML sitemap generator for Google’. If you plan to use this plugin with another SEO plugin, you will need to disable the sitemap feature in your main SEO plugin.

XML sitemap generator for Google is a popular sitemap generator plugin with solid ratings and more than one million active installations. Configuring the plugin is also quite easy. Just install and activate the plugin. You can find the plugin configurations inside the Wordpress dashboard among the Wordpress settings. Expand the wordpress settings and you will find the settings for XML sitemap at the bottom.

Scroll down to the sitemap content section and then select the type of urls that you want to be included in the sitemap. You can exclude categories and archives and any other post type you do not want included. Most of the default settings are fine, and the sitemap content section is the main section requiring your attention. Now, save the changes and then you can visit the sitemap by appending sitemap.xml to your website url.

Manually create and upload a sitemap

If you are not a coder or do not know how to edit html code or write xml, use the above listed plugins (any of them) to generate a sitemap. Manually creating a sitemap might be possible when the number of urls to be included is low. You can use a text editor like notepad to create a sitemap.xml and upload it to the root directory of your wordpress website.

Here is a very basic sitemap including the location of a single url:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/foo.html</loc>
<lastmod>2022-06-04</lastmod>
</url>
</urlset>

This is how you can format your sitemap and include multiple urls. Once you have saved the file as sitemap.xml, upload it to the root folder of your wordpress website using FTP.

Another way to add a sitemap to your website is to do it via the server. SSH to your server and then using an editor like nano or vim create an xml sitemap in the desired format.

If you do not want to do the manual work, then go to the xml-sitemaps.com website and generate a sitemap using the sitemap generator tool. Copy the contents of the xml sitemap generated by the tool and upload it to the root folder or using the nano editor, create the sitemap.xml file in your root folder.

Suggested Reading

Wordpress Guide for Beginners

Submit Your Site to Google Search Console

Five Best SEO Plugins for Wordpress

Install and Configure the WP-CLI

How to Start A New Wordpress Blog