Short answer: you probably already have one. Since version 5.5 (August 2020) WordPress makes an XML sitemap by itself at /wp-sitemap.xml, for example https://www.example.com/wp-sitemap.xml. Submit that address in Google Search Console and Bing Webmaster Tools and you are done.

What the WordPress sitemap contains

/wp-sitemap.xml is a sitemap index: a list of smaller sitemaps for your posts, pages, categories, tags and authors. Each of those holds up to 2,000 addresses; when there are more, WordPress adds another one. It updates by itself when you publish or delete something.

No sitemap at that address? Check Settings → Reading: when Discourage search engines from indexing this site is ticked, WordPress makes no sitemap at all.

SEO plugins replace it

Most SEO plugins switch the WordPress sitemap off and make their own:

  • Yoast SEO and Rank Math: /sitemap_index.xml
  • All in One SEO: /sitemap.xml

Use the address of the sitemap that is actually there. Open it in your browser to be sure: you should see a list of addresses, not a "page not found" page.

Tell search engines where it is

  1. In Google Search Console, open Sitemaps, type the address of your sitemap and press Submit.
  2. Do the same in Bing Webmaster Tools.
  3. Check your robots.txt (https://www.example.com/robots.txt). WordPress adds a Sitemap: line for its own sitemap; with a plugin, make sure the line points to the plugin's sitemap.

When a crawler-made sitemap helps

The WordPress sitemap lists what is in your database. Our spider lists what a search engine can actually reach by following links. That difference is useful when:

  • you want to find pages that no menu or post links to: they are in the WordPress sitemap but missing from ours;
  • part of your site is not WordPress, like a shop, a forum or old static pages in a folder;
  • you want to check for broken links: our control panel lists every page that gave an error.

You can submit more than one sitemap for a site. Search engines combine them, and an address that is in two sitemaps does no harm.