You would want to hide the XML Sitemap from your competitors and everyone that manually browses the link for a range of reasons. The link for the XML sitemap of your website can be example.com/sitemap.xml. The sitemap can vary depending on the way you have chosen to generate it. The reasons for hiding the sitemap can be you don’t want your competitors to know about the depth of your content or you may be a news site that wants to hide its new content from competitors.
The internet is a messy place. When people credit the source, you may be more than willing to share your content for the reference of those websites, but most of the time your content would be rehashed without any credit to the source. And the worst happens when such spam sites rank higher than you on the SERP. The Google algorithms are advanced, but not advanced enough to credit originality. In such a scenario, hiding the XML Sitemap may seem like the only option.
How to Hide XML Sitemap Using Plugins on WordPress
In order to hide the site from your competitors, you need to be on the WordPress CMS. WordPress is great as it allows you to perform almost everything with the help of plugins. However, there is no guidance or specific plugin that allows you to hide the XML sitemap. Instead, you have to rely on two plugins that when combined produce the effect where the sitemap is hidden from everyone except the search engines.
The two plugins we are talking about are XML Sitemaps by Auctollo and WP Content Copy Protection by Tyche Software.
You will use the XML Sitemaps plugin to generate the sitemap and then install the WP Content Copy Protection that will block the XML sitemap.
After you have installed the two plugins, if you check the sitemap for the website, you will get an error message like below, but the sitemap would not be blocked to the search engines.
No one can view the sitemap. So, to follow the above procedure, you will first need to be on the WordPress platform and then install the two plugins. Note though, the process does not work with any other sitemap generator specifically Yoast SEO.
We have personally tested and use the above method to block the sitemap to competitors on our website.