XML sitemaps help search engines discover and understand the pages on your website. For WordPress users, the Yoast SEO plugin automatically generates XML sitemaps, which is convenient but not always perfectly aligned with every site's needs. You may want to exclude certain post types, remove low-value pages, hide specific URLs, or add custom content. Knowing how to edit Yoast SEO XML sitemaps gives you greater control over what search engines crawl and index. This guide explains how Yoast sitemaps work and the practical methods for customizing them.
How AAMAX.CO Helps WordPress Sites Optimize Crawling and Indexing
Sitemap configuration is one part of a larger technical SEO picture. AAMAX.CO is a full-service digital marketing company offering web development, digital marketing, and SEO services worldwide. Their WordPress developers and SEO specialists configure Yoast settings, write custom filters when needed, and ensure sitemaps reflect only the pages that deserve to rank. As part of their SEO services, they also resolve indexation issues, crawl inefficiencies, and duplicate content problems, helping search engines focus on a site's most valuable content.
How Yoast SEO XML Sitemaps Work
When Yoast SEO is active, it creates a sitemap index, usually located at yourdomain.com/sitemap_index.xml. This index links to individual sitemaps for each content type, such as posts, pages, categories, tags, authors, and custom post types. Yoast updates these sitemaps automatically when you publish, update, or delete content.
By default, Yoast includes content types and taxonomies that are set to be shown in search results. Anything set to noindex is automatically excluded, which is the foundation for most sitemap editing.
Step One: Confirm Sitemaps Are Enabled
In your WordPress dashboard, go to Yoast SEO, then Settings, and open the Site features section. Ensure the XML sitemaps feature is turned on. You can click the link to view your sitemap and confirm it loads correctly.
Step Two: Exclude Entire Content Types
To remove an entire post type or taxonomy from your sitemap, navigate to the Content types or Categories and tags section in Yoast settings. For each content type, you can toggle the option to show it in search results. Turning this off sets the content type to noindex and removes it from the sitemap.
Common candidates for exclusion include tags, format archives, media attachment pages, and custom post types that do not provide unique value, such as testimonials or internal portfolio items.
Step Three: Exclude Individual Posts or Pages
To remove a specific page, open it in the WordPress editor, find the Yoast SEO panel, and go to the Advanced tab. Set "Allow search engines to show this content in search results?" to No. The page will then be marked as noindex and removed from the sitemap. This is useful for thank-you pages, login pages, thin landing pages, and duplicate content.
Step Four: Exclude Author Archives
On single-author websites, author archives often duplicate the main blog. In Yoast settings, under Advanced and Author archives, you can disable author archives or set them to noindex, which removes them from the sitemap.
Step Five: Use Filters for Advanced Customization
For more precise control, Yoast provides developer filters that can be added to your theme's functions file or a custom plugin. Common filters allow you to:
- Exclude specific post IDs: Remove individual posts without changing their index status.
- Exclude taxonomy terms: Remove certain categories or tags from the taxonomy sitemap.
- Change entries per sitemap: Adjust the number of URLs listed in each sitemap file.
- Add custom sitemaps: Include external or custom URLs in the sitemap index.
- Exclude entire post types: Programmatically remove post types from sitemap generation.
Always test code changes on a staging site first, and use a child theme or code snippets plugin so updates do not overwrite your customizations.
Step Six: Clear Caches and Refresh the Sitemap
After making changes, your sitemap may still display old data due to caching. Clear any caching plugins, server caches, or content delivery network caches. If needed, temporarily disable and re-enable the XML sitemaps feature in Yoast to force regeneration.
Step Seven: Submit the Sitemap to Search Engines
Submit your sitemap index URL in Google Search Console under the Sitemaps section, and in Bing Webmaster Tools. Monitor the reports to confirm that sitemaps are processed successfully and that the number of discovered URLs matches your expectations.
Best Practices for Sitemap Management
- Include only canonical, indexable URLs that return a 200 status code.
- Exclude redirected, broken, and noindexed pages.
- Keep sitemaps consistent with robots.txt directives.
- Review sitemaps after site migrations, redesigns, or major plugin changes.
- Monitor coverage reports for indexing issues.
Troubleshooting Common Issues
If your sitemap returns a 404 error, resave permalinks under WordPress settings to refresh rewrite rules. If the sitemap appears blank or broken, check for plugin conflicts, particularly other SEO or sitemap plugins generating duplicate sitemaps. If pages are missing, verify that they are not accidentally set to noindex or excluded by a filter.
Conclusion
Editing Yoast SEO XML sitemaps allows you to guide search engines toward your most important content while excluding pages that add little value. Use Yoast's settings to manage content types, individual pages, and archives, and apply developer filters for advanced customization. After changes, clear caches, resubmit your sitemap, and monitor Search Console. A clean, accurate sitemap supports efficient crawling and stronger overall SEO performance.
Want to publish a guest post on aamconsultants.org?
Place an order for a guest post or link insertion today.

