XML Sitemap in WordPress

How to Create an XML Sitemap in WordPress?

Do you want to add an XML sitemap for your WordPress site?

An XML sitemap helps search engines such as Google quickly go through your website and display a list of your site content in a machine-readable format.

This Write up will share what an XML sitemap is and how you can create an XML sitemap in WordPress.

What is an XML Sitemap?

An XML sitemap is a kind of file that lists up all your content in XML format. 

A good sitemap is like a roadmap of your site that helps search engines to understand your website structure and leads them to your site’s important pages and index your content.

Nowadays, sitemaps are produced in XML instead of HTML, and their overall usage has evolved.

For instance, The target audience of sitemaps is search engines now, not the people.

The sitemap is a way for website owners to notify search engines about all the content present on their site.

It also notifies you about the more important pages/ links on your site and how regularly you update your website.

Why will You Need a Sitemap?

Sitemaps are beneficial for search engine optimization for new websites as well as older ones.

It does not boost your search rankings, but when you upload new content to your site, it gives you a way to let search engines know about that content to index it. 

The sitemap lets you highlight the important part of your websites, highlight which parts are more frequently updated, and more, So search engines can find and index your content accordingly. 

It lets search engines better crawl your website and display your content in search results, increasing your web traffic and SEO ranking of your site.

These are very meaningful when you create a new website or start blogging. It’s harder for search engines to find and locate all of your content.

Luckily, search engines such as Bing and Google let new website owners submit their sitemaps in their webmaster tools. This helps their search engine bots to find and index their content easily. 

How to Create a Sitemap in WordPress?

You can create an XML sitemap in WordPress in many ways.

We will share three different methods, without a plugin, using Yoast SEO plugin, and using the All in One SEO Plugin. Select the one that fits you.

Then you will know how you can submit your XML sitemap to search engines and How you can utilize XML sitemaps to expand your website.

Method 1. creating an XML Sitemap in WordPress without a Plugin

It is a basic method to create a sitemap that offers limited features.

Before 2020 WordPress does not have an in-build feature to add sitemaps to your site. Now, WordPress5.5 comes with a basic XML sitemap feature.

It lets you build an XML sitemap in WordPress without using any plugin. You can see your default XML sitemap by adding wp-sitemap.xml at the end of your domain name.

But the method is not flexible, and you cannot control what to add or exclude from your XML sitemaps.

Fortunately, many of the WordPress plugins come with their sitemap feature.

These sitemaps are better than earlier ones, and you can control the content appearing on the site map, and you can add or remove content from your WordPress XML sitemaps according to you.

Method 2. Create an XML Sitemap in WordPress using Yoast SEO

The Yoast SEO plugin is the best method to create an XML sitemap. 

It will automatically turn on XML sitemaps for you.

To begin with the Yoast SEO plugin, You have to install and activate the plugin first. For more details, You can see our step-wise tutorial on how to install a WordPress plugin for more details.

After activation, visit the SEO » General page and click on the ‘Features’ option.

Now, scroll down to the ‘XML Sitemap’ option and make sure it is switched on.

Then, click the save changes option to store your changes.

You can verify that Yoast SEO has created an XML Sitemap for your site. For this, click the question mark icon next to the XML Sitemap option on the page.

Then, click on the ‘See the XML Sitemap’ link to see the live XML sitemap generated by Yoast SEO.

You can also look at your XML sitemap by adding sitemap_index.xml at the end of your website address. For instance:

https://www.example.com/sitemap_index.xml

 

The Yoast SEO produce multiple sitemaps for different types of content on your sites, such as sitemaps for pages, posts, author, and categories.

Method 3. Create an XML Sitemap in WordPress using All in One SEO

Another method to create an XML sitemap in WordPress is the All in One SEO plugin.

 

It is the WordPress SEO plugin on the market, providing you with a complete set of tools to optimize your posts for SEO.

To start, Install and Activate the All in One SEO plugin.

For more details, You can also see our step-wise tutorial on installing a WordPress plugin for more information.

Note:  AIOSEO Free version provides a sitemap feature, But if you want to use advanced features such as news sitemap and video sitemaps, you have to get its Pro version.

After ActivationActivation, you can review sitemap settings by visiting the All in One SEO » Sitemaps page. 

 

The All in One SEO plugin will enable its Sitemap feature and replace the default WordPress sitemaps.

To preview your sitemap, click the ‘Open Sitemap’ option. You can also view it by adding ‘sitemap.xml’ to the URL like-www.example.com/sitemap.xml.

 

You can use the Default sitemap settings that work well for all kinds of websites, blogs, and online stores. But, if you want to control what you want to include or exclude in your XML sitemap, you can customize the settings.

To customize the settings, scroll down to the Sitemap settings section.

It will provide different options, including/excluding post types, managing sitemap indexes, taxonomies (categories and tags), and many more.

After adjusting the settings, click the ‘Save Changes’ option to save your settings.

Exclude Specific Posts / Pages from your XML Sitemap

This plugin automatically includes all your WordPress content in your XML sitemaps.

However, it lets you exclude any post or page from your XML Sitemap. For this, click the Advanced Settings option under the All in One SEO » Sitemaps page.

You can also exclude a post/page from your XML sitemaps by making it no-index and no-follow. 

Edit the post/page you want to exclude and scroll down to the AIOSEO Settings box under the text editor.

Now, click the Advanced tab and check the boxes in front of the ‘No Index’ and ‘No Follow’ options.

After this, the search engines will not display that content in search results.

Create Additional Sitemaps using All in One SEO

You can also create different sitemaps on your WordPress sites, such as a video sitemap or a news sitemap using All in One SEO.

You can create a video sitemap for your site if you regularly use or insert videos in your pages or blog posts. It lets search engines show posts and videos in search results along with a video thumbnail.

If you own a news website and want to appear in Google News search results, you can create a News sitemap for your site.

Visit the All in One SEO » Sitemaps and select the Video Sitemap or News Sitemap option to generate these sitemaps.

How to Submit the XML Sitemap to Search Engines

The Search engines work smartly to find a sitemap. Whenever you upload new content to your site, a ping is sent to them( Google and Bing) to notify them about changes in your sitemap.

But, we suggest that you submit your sitemap manually to search engines to make sure they can locate it.

Submitting Your XML Sitemap to Google

Google offers a free tool named Google Search Console to help website owners to maintain and monitor their site’s presence in Google search results.

Attaching your XML sitemap to Google Search Console will help to discover your content quickly, even if your website is new.

For this, go to the Google Search Console website and sign up to create an account.

Then, you have to select a property type to start with the Google search console.

You can select a domain or a URL prefix. We suggest choosing a URL prefix as it is easier to set up.

Add your website’s URL and click the continue option to start with the URL prefix.

Then, you have to verify ownership of the website. You will get multiple methods to do that. We suggest using the HTML tag method.

For that, copy the code given on the screen and then visit your WordPress website’s admin area.

If you are using the AIOSEO plugin, visit the All in One SEO » General Settings and select the Webmaster Tools option. Now, paste the code you copied from Google.

If you are not using the AIOSEO plugin, you have to install and activate the Insert Headers and Footers plugin.

You can see our step-by-step tutorial on how to install a WordPress plugin for more details.

After activation, you have to visit the Settings » Insert Headers and Footers page and then paste the code you copied from Google earlier in the ‘Scripts in Header’ box.

Now, click the Save option to store your changes.

Afterward, go back to the Google Search Console and click on the ‘Verify’ option.

Google will check the verification code on your site. After that, add your site to your Google Search Console account.

Note: If the verification fails, then you can clear your cache and try again.

After adding your website to the Google search console, let’s add your XML sitemap.

Click on ‘Sitemaps’ from your google console account dashboard.

Now, add the last part of your sitemap URL into the ‘Add new sitemap’ section and then click on the Submit option.

Now, Google will add up your sitemap URL to your Google Search Console.

Google may take some time to crawl your website. After that, you will see the basic sitemap stats.

It includes the number of links Google found in your sitemap, a ratio of images to web pages, how many of them got indexed, and more.

Now you have successfully added your XML sitemap to the Google search console.

Submitting Your XML Sitemap to Bing

Bing also provides Bing Webmaster Tools to help website owners monitor their website in the Bing search engine, similar to Google search console.

You can add your sitemap to Bing. For this, go to the Bing Webmaster Tools website.

Now you will get two options to add your site. Either you can import your site from Google Search Console or add it manually.

You can import your site from Google Search Console if you’ve already added your site to it. As it is time-saving and your sitemap will be imported for you automatically.

If you want to add your site manually, you have to enter your site’s URL and then verify your site.

To verify ownership of your website, you will get different options.

We suggest using the Meta tag option that is simple and easy to use. Copy the meta tag line from the screen and visit your WordPress admin area.

After that, install and activate the Insert Headers and Footers plugin on your website.

You can see our step-by-step tutorial on how to install a WordPress plugin for more details.

After Activation, go to Settings » Insert Headers and Footers page. 

Now, paste the meta tag line code you copied earlier into the ‘Scripts in header’ box and click the Save option to store your changes.

How to Utilize XML Sitemaps to expand Your Website?

After submitting the XML sitemap to Google, you can utilize it for your website.

Remember that the XML sitemap does not improve your search rankings. But, it does help search engines to adjust crawl rates, find content, and improve your website’s visibility in search engines.

It would be best to keep visiting your sitemap stats in Google Search Console. It can display the crawl errors and the excluded pages from search coverage.

Under the charts, you can click on the tables to see the actual URLs excluded or not indexed by Google.

Generally, Google may skip duplicate content and pages with little content. Also, the pages are excluded by your website’s meta tags or robots.txt file.

Although, if you notice the unusually high number of excluded pages, you must check your SEO plugin settings to ensure that you are not blocking any content.

To conclude, we hope this tutorial helped you understand what XML sitemaps are and create an XML sitemap for your WordPress site. We have also explained how you can submit your sitemap to the Google search console and how you can utilize XML sitemaps to grow your website.

Leave a Comment