How To Exclude Custom Post Types From The Sitemap.xml

Sometimes, you need to hide certain post types from Google Search Console, Google search results, your website’s search results, or you don’t want them in your sitemap.

It’s really easy to do this. You simply need to change a small attribute when you register your post type in WordPress.

If you use a custom post type plugin such as Custom Post Type UI or Custom Post Type Maker, you need to edit the post types you want to exclude and uncheck the publicly_queryable attribute.

 

publicly queryable off

 

By doing this, you will exclude your post type from your public queries and it will no longer be visible in the sitemap.xml file.

If you want to exclude the post type from your website search results, you can check exclude_from_search and it will no longer be listed when someone searches for a match on your website.

Leave A Comment?