There are several ways to create an XML sitemap in WordPress. At WPBeginner, we use Yoast’s WordPress SEO plugin to generate our sitemaps. We use this plugin because it allows us to optimize our blog posts along with offering other features such as sitemaps, social integration, and more. We have also noticed that it works more efficnelty than other standalone sitemap generators for WordPress. Lastly, it also offers custom sitemaps like the Video Sitemap.
To add a sitemap to your WordPress site, first thing you need to do is install and activate WordPress SEO by Yoast plugin. By default, WordPress SEO does not enable XML sitemap functionality, so you will have to turn it on. To do that go to SEO » XML Sitemaps and check the box to enable XML sitemap functionality.
Enable XML WordPress Sitemaps in WordPress SEO plugin
When you check the box to enable XML sitemap functionality, WordPress SEO will show you a number of options that you can configure for your Sitemaps. If you are unsure about what to do with them, then ignore them and click on Save settings.
Now your sitemaps are generated and publicly accessible. WordPress SEO will show a XML Sitemap button which you can click to view your sitemap_index.xml sitemap.
How to Tell Search Engines About Sitemaps?
Search engines are quite smart in finding a sitemap. Whenever you publish new content a ping is sent to Google and Bing to inform them about changes in your sitemap. However, we recommend that you submit your sitemap to Google by using Google Webmaster tools. The benefit of this is that Google will now show you any errors, pages indexed, and other relevant stats that will be helpful to you as a webmaster.
Go to Google Webmaster Tools. If you are not already signed in to your Google account, then you will be asked to sign in. After signing in you will reach webmaster tools. There you will see “Add a site” button, click it and then add the URL of your website.
On the next screen you will be asked to verify the ownership of the website you are trying to add. There are several methods to do that. But since you are already using WordPress SEO plugin, then the easiest method for you is to copy the HTML Meta tag value and paste it in WordPress SEO plugin. To do that click on Alternate methods and then on HTML Tag. You will then see a line of HTML Meta tag code.
Verify ownership of your website in Google Webmaster Tools with HTML Meta Tag
Copy and paste this line in a text editor like notepad. Now copy the value inside the content=””. Leave the webmaster tools site verification page open because we will come back to the page after adding the meta tag to verify the ownership of the website. Go to your WordPress admin area and then click on SEO tab. This will take you to WordPress SEO plugin’s dashboard. Scroll down, and you will see Webmaster Tools heading. Paste the meta tag value you copied next to Google Webmaster tools and Save Settings.