WordPress does not create a sitemap.xml by default. Plugins are used to generate one—most commonly Yoast SEO or Rank Math. Both generate sitemaps automatically and let you configure which content types to include. This article explains how to configure a sitemap in WordPress with Yoast and Rank Math.
Yoast SEO: sitemap settings
Enabling the sitemap
- Go to SEO → General
- Open the Features tab
- Enable XML Sitemaps
By default, the sitemap is available at https://ваш-сайт.ru/sitemap_index.xml.
Managing content types
SEO → Search Appearance → Content Types
Here you can enable or disable the following in the sitemap:
- Posts
- Pages
- Media files (images)
- Custom post types (CPTs)
- Taxonomies (categories, tags)
Recommendations:
- Enable posts and pages
- Enable media files if images are important for search (for example, galleries)
- Include categories and tags as appropriate: blogs often include them, while online stores sometimes exclude them to avoid duplicates
Excluding individual posts
In the post/page editor, you can set a page to “Noindex” in the Yoast panel. These pages will not be included in the sitemap.
Additional settings
SEO → Search Appearance → Archives
- Author archives — can be disabled if not needed
- Date archives — disable to reduce duplicates
- Categories and tags — include only if they provide search value
Rank Math: sitemap settings
Enabling the sitemap
- Rank Math → Setup Wizard (or Rank Math → Sitemap Settings)
- Enable Sitemaps
- The sitemap will be available at
https://ваш-сайт.ru/sitemap_index.xml
Managing content types
Rank Math → Sitemap Settings → Post Types / Taxonomies
| Type | Recommendation |
|---|---|
| Posts | Enable |
| Pages | Enable |
| Media | As needed |
| Categories | Enable for blogs |
| Tags | Enable for blogs |
| Products (WooCommerce) | Enable |
Excluding URLs
In Sitemap Settings → Exclude, you can specify:
- Post and page IDs
- Taxonomy slugs
- Regular expressions for paths
Example of excluding utility pages: /cart/, /checkout/, /my-account/.
Priority and update frequency
Rank Math lets you set the following for each content type:
- Priority (0.0–1.0)
- Change Frequency (always, hourly, daily, weekly, monthly, yearly, never)
For a blog: posts — weekly, pages — monthly, homepage — daily.
Comparing Yoast and Rank Math
| Parameter | Yoast SEO | Rank Math |
|---|---|---|
| Sitemap enabled by default | Yes | Yes |
| Exclusion by ID | Via noindex | Directly |
| Exclusion by path | Limited | Regex |
| Images in sitemap | Separate sitemap | Separate sitemap |
| News sitemap | News plugin | Built in |
| Video sitemap | Video plugin | Built in |
Specifying the sitemap in robots.txt
Both plugins automatically add this line to robots.txt:
Sitemap: https://ваш-сайт.ru/sitemap_index.xmlCheck Settings → Reading or via FTP to make sure this line is in robots.txt.
Submitting to Google Search Console
- Open Google Search Console
- Select your property (website)
- Select Sitemaps from the left-hand menu
- Enter
sitemap_index.xmlorsitemap.xml(depending on the plugin) - Click Submit
Do the same in Yandex Webmaster: Indexing → Sitemap files.
Checking the sitemap
After configuring it, check the following:
- Open
https://ваш-сайт.ru/sitemap_index.xml— the index should be displayed - Follow the links to individual sitemaps and check that they contain the required URLs
- Check your sitemap on reChecker — validation and error detection
Common problems
The sitemap returns 404
- Check that permalinks are enabled (Settings → Permalinks)
- Clear the plugin and hosting caches
- Deactivate other sitemap plugins (conflict)
Duplicate pages in the sitemap
- Disable date and author archives if they create duplicates
- Exclude pagination (page/2/, page/3/) — plugins usually do this automatically
- Check the noindex settings for duplicates
Too many URLs
- Exclude tags if there are hundreds of them and they provide no SEO value
- Exclude media files if this is not a media website
- Use a sitemap index — plugins create one automatically when there are many URLs
For more information about errors, see the article about sitemap errors. General principles are covered in the sitemap creation guide and the sitemap optimization guide.
Additional sitemaps in Yoast and Rank Math
Yoast: News Sitemap
For news websites, Yoast News adds a separate News Sitemap. It requires configuration in the plugin and registration with Google Publisher Center.
Yoast: Video Sitemap
Yoast Video creates a sitemap for videos. It specifies the duration, description, and preview. It helps with indexing in Google Video.
Rank Math: WooCommerce
Rank Math automatically includes WooCommerce products in the sitemap. Configure this in Sitemap Settings — Post Types.
Conflicts with other plugins
Several plugins may generate sitemaps at the same time (for example, Yoast + All in One SEO). Keep only one. Check by opening /sitemap.xml or /sitemap_index.xml — only one version should be displayed.
Frequently asked questions
How do I change the sitemap URL?
By default, Yoast and Rank Math use /sitemap_index.xml. You can change the base path in the settings, but this may disrupt indexing in Search Console, so it is best to leave the default.
Should I exclude noindex pages from the sitemap?
Yes. Pages with noindex should not be in the sitemap. Plugins usually exclude them automatically.
How can I check that the sitemap is being updated?
Add a new post or page and open the sitemap—the new URL should appear. Check lastmod in the XML: the date should match the latest change.
Conclusion
Yoast SEO and Rank Math generate sitemaps automatically. Configure which content types to include or exclude, submit the sitemap in Search Console, and check the result with the reChecker sitemap checker.