Sitemaps expedite this process by providing search engine robots with a detailed map of your site. Instead of having to crawl your site manually by finding internal links to all your content, the crawler can instantly know where every public page in your website is located.
While by no means a magic bullet for SEO, sitemaps will improve the indexing of your site. And that means it’s more likely that all your posts and pages get included in search results.
They also allow you to provide search engines with optional information like when a page was last updated, how often a page changes, and how important a page is. This information can further help search engines optimize how they crawl your site.
XML vs HTML Sitemaps
XML sitemaps are the most common implementation. They’re exactly what I discussed above – a map dedicated almost entirely to search engines. Their data isn’t really useful to humans, so the only reason to create one is to boost your indexing.
HTML sitemaps, on the other hand, can be used by both humans and search engines. It’s an actual page on your website where humans and search engines can get a high-level overview of all the content your site offers. Search engines can still crawl this page, but it also gives some curious visitors a better user experience.
So which type should you use?
The answer is BOTH. It’s not an either/or question. They don’t conflict and both types offer benefits. If you don’t believe me, check out former Google SEO guru Matt Cutts talking about why you should include both XML and HTML sitemaps:
XML Sitemap – plugins
Given the popularity of SEO plugins, there’s a good chance you already have all the necessary functionality to create an XML sitemap. If you use Jetpack, Yoast SEO, All in One SEO, Google Sitemaps, or SEOPressor, you just need to find the relevant plugin setting to set up your XML sitemap.
Jetpack allows you to generate such files thanks to the Sitemaps module.
If you already have the plugin activated & running, ensure you are using the latest version of Jetpack.
Now, head to Jetpack > Settings > Engagement & look for module call Sitemaps & activate it.
Unlike other sitemap plugins for WordPress, here you don’t need to configure anything. This is a limitation for big WordPress sites but a new or medium size blog; you don’t need to configure anything apart from submitting your sitemap to search engines.
Once you activate the module, Jetpack will generate two different sitemaps for you: a sitemap listing all your public posts and pages, and a News sitemap built specifically for Google News:
Normal sitemap: yoursitename.com/sitemap.xml
- News Sitemap:
2. Yoast SEO
Yoast SEO you just need to navigate to SEO → XML Sitemaps to enable and configure it:
One nice feature with Yoast SEO’s sitemap tool is the ability to include media attachments in your XML sitemap:
When enabled, this can boost your traffic from Image Search by increasing the indexing of your media uploads.
How do I know if I need to add the redirect rules?
The Yoast SEO XML sitemap URL uses a pretty permalink of example.com/sitemap_index.xml but, behind the scenes, this URL also has a non-pretty permalink of example.com/?sitemap=1. If you can load and see the sitemap using the non-pretty permalink, your server is not setup to redirect and, thus, you’ll need to add redirect rules.
3. All in One SEO
With All in One SEO plugin installed, just navigate to All in One SEO → XML Sitemap:
4. Google XML sitemap
After you install the plugin, you can configure it by going to Settings → XML-Sitemap:
Here’s what you’ll definitely want to configure on that page:
- Post priority: Set how you want to calculate posts’ crawling priorities. You can have the plugin automatically calculate priority by the number of comments, or manually set the priority later on.
- Sitemap content: Choose what types of content get included in your sitemap. For example, if you want to exclude category archives, you just need to uncheck that box.
- Change frequencies: Set how often each type of content gets changed. This gives search engines an idea of how to prioritize their crawling. For example, you’ll definitely want to set the page which displays your recent posts to be crawled daily.
- Priorities: Lets you set manual crawling priorities for different content. You definitely want your homepage and posts page (if different) to be high priority.
- Using NGINX:
In some cases, you may need to add server level redirects if you receive an NGINX server error or a wrong page when loading the XML sitemaps.Basic Code
# Rewrites for Yoast SEO XML Sitemap
<span class="hljs-title">rewrite</span><span class="hljs-regexp"> ^/sitemapindex\.xml$</span> /index.php?gxs_module=sitemapindex <span class="hljs-built_in">last</span>;
<span class="hljs-title">rewrite</span><span class="hljs-regexp"> ^/post\.xml$</span> /index.php?gxs_module=post <span class="hljs-built_in">last</span>;
<span class="hljs-title">rewrite</span><span class="hljs-regexp"> ^/page\.xml$</span> /index.php?gxs_module=page <span class="hljs-built_in">last</span>;
<span class="hljs-title">rewrite</span><span class="hljs-regexp"> ^/post_google_news\.xml$</span> /index.php?gxs_module=post_google_news <span class="hljs-built_in">last</span>;
<span class="hljs-title">rewrite</span><span class="hljs-regexp"> ^/taxonomy_category\.xml$</span> /index.php?gxs_module=taxonomy_category <span class="hljs-built_in">last</span>;
Tell Search Engines About Your XML Sitemap
Now that you’ve created your sitemaps, there’s one more thing you need to do:
Tell search engines exactly where they can find it.
By showing search engines where you keep your sitemap, you ensure they find it, which means they’ll know whenever you publish changes to it and your site.
To submit your sitemap to Google, you’ll need to sign up at Google Search Console and follow their instructions for submitting a sitemap.
The process is quite similar for submitting your sitemap to Bing. You’ll need to sign up at Bing Webmaster Tools and then submit your sitemap by following their directions.