Prefer meta tags to robots txt for avoiding indexing

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the web-development category.

Last Updated: 2024-04-19

If you want Google not to index something, it is insufficient to put it in the robots.txt if you link to it from your public site. You also need the following in the head:

<meta name="robots" content="noindex">

This has the added advantage of not revealing your site structure in the easily parsed robots.txt

Resources