TechTipsApp

Technology tips blog

  • Articles
    Categories
    • Tech news
    • Internet
    • Social Network
    • Google
    • Geeky Tips
    • Android
    • Windows 10
    Top Posts
    • Install Windows XP from USB
    • Install Windows 7 from USB
    • Open Facebook When It's Blocked
    • Partition Hard Drive Without Formatting
    • Reset Windows 7 Password
    • About
    • Contact
    • Privacy policy
    • Advertise
    • Terms of Conduct & Copyright Policy

Prevent Search Engines From Indexing Your Sitemap File by Adding Noindex X-Robots-Tag

Tanmay WordPress Leave a Comment

Sitemap is an important part of your site that contains the information of every single page, videos,  images to notify Google. For instance, sitemap plays a great roll to help Google to discover a page you have in your website that is not linked through other post/pages.
The problem is that, as it contains a lot of text, it can stay at a higher position in the search results, competing with other post or pages. So it is better to prevent search engines from indexing your sitemap files. But, if it would be a normal HTML page then you could easily do that by adding a Noindex meta tag. Unfortunately, XML file does not allow you to do so. Here is the simple solution.
Download your site’s .htaccess file residing at the root folder of your site. Open it with any text editor and then just add this code in your .htaccess file.

<IfModule mod_rewrite.c>
<Files sitemap.xml>
Header set X-Robots-Tag "noindex"
</Files>
</IfModule>

If you have multiple XML sitemap files in your site then you should put the code as following:

<IfModule mod_rewrite.c>
<Files ~ "^(sitemap1|sitemap2|sitemap3).xml$">
Header set X-Robots-Tag "noindex"
</Files>
</IfModule>

Save the changes and upload the file to its original location, replacing the older one.
How can I check that the code worked properly?
Well, go to URI Valet and put the full path of your sitemap.xml file.

If you notice the entry X-Robots-Tag with noindex in the server response, your implementation is successful.
[Via Digital Inspiration] .

Post Tags: Htaccess, Search Engine
Similar Articles from This Blog
How To Solve This Webpage has a Redirect Loop Problem
How To Solve This Webpage has a Redirect Loop Problem
Top 10 Meta Search Engines to Get More Search Result
Top 10 Meta Search Engines to Get More Search Result
How to Fix 404 Soft Errors in WordPress To Avoid Google Penalty
How to Fix 404 Soft Errors in WordPress To Avoid Google Penalty
How To Get Google Authorship MarkUp For Your Blog
How To Get Google Authorship MarkUp For Your Blog
Change Your Default Browser's Search Engine
Change Your Default Browser's Search Engine
Change Your Blog Search as Default Google Chrome Search Engine
Change Your Blog Search as Default Google Chrome Search Engine

Comments

  1. Shiva | Web Magazine :

    Aha, great tutorial mate. I think it is quite a nice idea to hide the sitemap from search engines since I think it is better it does not show to the readers

    Reply
  2. Tanmay :

    Absolutely Shiva. Thanks for your comment.

    Reply
  3. Laxmi :

    X-Robots tags is used only in Apache Hosted sites not for IIS Hosted sites because IIS Not support .htaccess. Reply mee

    Reply
    • Tanmay :

      Yes….This method is only for the Apache servers. The article is based on the WordPress blogs. BTW thanks for your comment.

      Reply
  4. vijay :

    my server is Window and its not support .htaccess file than how i can do it in web.config file ?
    pls if u have any idea let me know.
    Thanks
    vijay lathiya

    Reply

Leave a Comment Cancel reply

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

About Us

Tech Tips App is a technology blog, looking forward to broaden the mental horizons of technical geeks round the web. Striving hard to quench your technical thirst, we have put our best efforts on the line of exhaust to satisfy your versatile technical vocabulary.

Recently Published

  1. Partitioning Hard Drive in Windows 7 Without Formatting
  2. How to Find My Contacts on Google Map
  3. Introducing SMS Organizer by Microsoft is the Best SMS App
  4. How to Fix Windows Update When It Gets Stuck
  5. How to Get Rid of Windows 10 Automatic Repair Loop [Solved]
  6. Best Antivirus for Windows 10 (Is Windows Defender Good Enough?)
  7. Best Facebook Messenger Bots to Get more out of Messenger
  8. How to Fax a Document From Your Smartphone
  9. Top Social Media Platforms You Should Always Know About
  10. Bitcoin vs Altcoin: Where to Invest? – Guide For Dummies

© 2021 Tech Tips App All Rights Reserved  Post Sitemap