Posted on Leave a comment

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap 1

If you want to exclude certain custom post types to the sitemap that generated by Yoast SEO plugin, you are at the right place. In this short post, I’m going to show you exactly how to do that.

Requirements

The only requirement is you need to install my plugin. This is the one I made to solve my own problem. As you can see, I created a plugin called WP Lead Plus X that generates landing pages. It created two custom post types to handle the template files.

I don’t want include those files in the sitemap since they have short content and usually don’t reflect the topic of my main website.

Download the plugin to exclude custom post types from Yoast SEO sitemap below

How to configure what post types to exclude from Yoast SEO site map

Now I assume that you have installed and activated the plugin. In your dashboard, you’ll see it appears under Binary Carpenter:

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap 2

Click on that, you’ll find a very simple interface:

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap 3

As you can see, the plugin lists the custom post types available on your site as an unordered list. In my example, I have three custom post types:

  • product
  • core37_lp
  • core37_lp_template

Now, for example, I want to exclude core37_lp and core37_lp_template post types from the sitemap. I’ll enter them into the textarea box below, comma delimited:

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap 4

Before clicking on the save settings button, let me show you my current sitemap:

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap 5

As you can see, my custom post types are showing in the sitemap. Let me save changes and reload the sitemap again:

How To Exclude Custom Post Types, Posts, Pages From Yoast SEO Sitemap 6

As you can see, the new sitemap doesn’t have the custom post types that I excluded.

Bonus feature

As you can also see in the plugin, you have the ability to exclude certain pages/posts from the sitemap. Simply enter their IDs as comma separated list and they’ll be exclude from your Yoast SEO sitemap.

Conclusion

I hope this plugin is useful to you. Note that it works with Yoast SEO sitemap only.