In this tutorial I am going to share how to exclude some posts from Yoast Sitemap. Yoast is a great SEO plugin for WordPress websites. If you have installed Yoast SEO plugin and enabled XML Sitemaps, then it’s time for you to learn how to exclude some posts from Yoast Sitemap.
Why do you need to hide some posts from Sitemap?
Well, it’s much needed to hide some pages from Sitemap. You don’t want to index your login, logout, unsubscribe, success or thank you pages in Google or any other search engines, right?
When you set up sitemap.xml for your website, these pages are automatically visible. To hide these pages, you need to exclude these pages from sitemap.xml
Another scenario could be, you have just imported demo data from a premium WordPress template. You have already modified and published all your required pages. Moreover, you have unpublished all those demo posts. But they can be visible in Sitemap.xml. In order to hide these pages, you have two options: Delete or Hide.
This is another reason why you should hide some pages from your Sitemap.xml
Now let’s get to the point. The point is:
How can I hide posts or pages from Yoast Sitemap
- Login to WordPress Admin Panel.
- Mouse over to SEO (Yoast Plugin)
- Click on “XML Sitemaps”
- Click on “Excluded Posts”. Here you will include all those posts/pages IDs what you want to hide from Sitemap.xml
How to Find Post/Page IDs in WordPress
I am just showing how you could find pages IDs in WordPress. Using similar method, you can find Posts IDs
#1: Mouse over to Pages. Click on “All Pages”
#2: Use “Search Box” to find your desired page (if you have 100s to 1000s of pages)
#3: Click on “Edit”
#4: Check the URL now. You need to take the ID just beside the “post=”
Now you need to include these IDs in “Excluded Posts” field of Yoast XML Sitemaps. This is how you can exclude some posts from Yoast Sitemap
Watch this video tutorial for better understanding. I have made this tutorial as one of my clients Sitemap.xml is containing some pages which he could hide using this method.