How to add sitemap to WordPress website

You probably heard term sitemap when speaking about websites and search engine optimization. This time we'll have a look how to add sitemap to WordPress website.

Here's what we'll learn today:

Let's begin!

What is sitemap, and why websites need sitemaps

Sitemap is a special format file which contains links to all the pages of a website. Google, Bing and other website crawlers read those files to make sure that all pages of a website are visible to search engines.

For example, if you have large website with articles, about and contact pages, sitemap will contain all links to those artcles and single pages of your site. So when Google checks the sitemap, it will know that all of those pages needs checking.

It's not the end of the world if a site does not have a sitemap - Google will look at the homepage, then will follow menu links and other internal links, and it will find most important pages anyway.

But if site has some pages which are not linked from menu or other pages of the site, those pages might not be visible to search engines. So if site has a sitemap, those missing pages will get to search engine crawlers anyway. And as a bonus Google will like your website more, because it follows it's recommendations.

Here you can read more about sitemaps.

How to add sitemap to WordPress

WordPress does not generate a proper sitemap for search engines by default. But it's not a big deal - there are plenty free plugins which will generate a sitemap for your WordPress site.

If you've read my article 11 must have plugins for any type of WordPress website you'll probably already have Yoast SEO plugin installed. That's great then - your website already has a great sitemap, because Yoast SEO automatically adds sitemap to WordPress websites. But if you don't have any SEO plugin in your site which generates sitemaps, you can install a plugin dedicated only to sitemaps.

Go to Plugins >> Add New in your WordPress admin menu, and enter sitemap to the search field. Look up for plugin named XML Sitemap & Google News, and install it.

how to add sitemap to wordpressOnce sitemap plugin is installed and activated go to Settings >> Reading, and enable sitemap in your WordPress site by checking the XML Sitemap Index checkbox.

how to enable wordpress sitemapAfter saving changes you'll be able to view the sitemap, or make some changes to it by hitting Settings:

wordpress sitemap settingsYou may leave sitemap settings as it is but I personally woud change two things.

First, I would add Taxonomies to the sitemap (category, tag pages) - check that Include taxonomies checkbox and save changes.

how to add categories and tags to sitemap in wordpressSecond - I would get rid of author's pages from the sitemap. Select Authors tab, uncheck Include authors, and hit Save Changes.

how to exclude author pages from sitemap in wordpressThat's it - now your WordPress website has a sitemap.

By default any website's sitemap should be accessed via link https://[yourwebsiteaddress.com] /sitemap.xml . Here how it looks like in my test website:

wordpress sitemap linkSome plugins render only plain sitemap code without styling, some plugins add styling to it. It does not matter for Google or other search engines - sitemap will do it's job anyway.

Other plugins, like Yoast SEO adds sitemap to /sitemap_index.xml file, but /sitemap.xml link redirects to it, so it's not an issue - Google will find your site's sitemap anyway.