Currently Available: Need a skilled Software Developer for your next project?
Categories
WordPress

What Happens to Your Sitemap When Hiding Post Types

In WordPress, a post type is a group of content, such as posts, pages, or a custom content type. Yoast SEO lets you keep a post type out of search results. When you turn off Show in search results for that type, Yoast marks its pages noindex and removes its sitemap from the XML sitemap index. The index lists the individual sitemaps on your site.

This changes how search engines treat the pages and which sitemap URLs Yoast lists, but it does not make the content private. Check the sitemap index and a page’s robots meta tag to confirm Yoast’s changes.

Turn off search visibility for the post type

In your WordPress dashboard, go to Yoast SEO → Settings → Content types and open the settings for the post type you want to hide. Turn off Show in search results. Yoast’s XML sitemap documentation describes how search visibility controls which content types appear in its sitemaps.

When the setting is off, Yoast adds a noindex directive to those pages. The directive tells search engines to exclude those pages from search results. Yoast also removes the post type’s sitemap from the sitemap index. A post type that is not public does not appear in Yoast’s settings, so this control cannot change its visibility.

What changes in the sitemap URLs

After you hide a post type, its child sitemap, the individual sitemap for that type, should no longer appear in the sitemap index. The index continues to list other content types’ sitemaps if those types remain eligible for indexing. Yoast’s sitemap functional specification explains how the plugin creates sitemap URLs.

If you request a child sitemap URL that Yoast no longer generates, that URL should return a 404 error, meaning the requested sitemap does not exist. The sitemap index itself can still work normally; removing one child sitemap does not mean Yoast has removed every sitemap.

Confirm the change and understand its limits

Open your site’s sitemap index and check that the sitemap for the hidden post type is gone. Yoast commonly uses a sitemap_index.xml filename. Then open a page from that post type and inspect its HTML source for a robots meta tag containing noindex, follow. The sitemap check shows that Yoast excluded the type from the index. The page check shows that Yoast marked its content for exclusion from search results.

The search visibility setting controls both outcomes. Setting noindex through the wpseo_robots filter alone does not remove a post type from the sitemap, as documented in a Yoast plugin issue. Use Yoast’s search visibility control when you want the post type removed from its sitemap.

Hiding a post type from search results does not block search engines from crawling its URLs. Search engines can still find pages through links, and visitors can still access them unless you restrict access separately. To keep the content private, use an access-control method. noindex and sitemap exclusion affect search visibility and sitemap listings; access controls determine who can view the content.

What I'm building

Delegate tasks. Get software.

Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.

Take a look at vroni.com

Email updates

Usually a new article and a few links I found interesting.

No spam. Unsubscribe with one click.

Leave a Reply

Your email address will not be published. Required fields are marked *