How to Keep Parts of Your Website Out of Search Results
Want to hide certain pages or sections of your site from search engines? You’re not alone. Whether it’s staging content, internal tools, or drafts, there are solid, straightforward ways to keep things out of Google’s index.
The most common method is the robots meta tag. Placed in the <head> of a page, it tells search engines like Google not to index that entire page. Just add <meta name="robots" content="noindex"> and you’re done. It’s clean, effective, and gives you page-level control.
But what if you only want to hide a section of a page? That’s where googleoff/googleon comments come in. Wrap the content you don’t want indexed like this: <!--googleoff: index--> ... <!--googleon: index-->. Google respects these tags and skips over the marked parts when crawling. Be aware, though—this only works with Google, not other search engines.
Need to block access to an entire directory? Create a no_crawl folder (or name it whatever you like) and configure your server to disallow crawling. Alternatively, use a robots.txt file to block access site-wide or to specific folders. While robots.txt prevents crawling, remember: it doesn’t guarantee de-indexing. Pages can still appear in search results if linked from elsewhere, so pairing it with a noindex tag is the safer move.
Ultimately, each method serves a different need. Use meta tags for individual pages, Google comments for partial content, and robots.txt or directory rules for broader exclusions. Just be careful not to accidentally hide important content—once it’s gone from search, it might take a while to come back.
Comments
No comments yet. Be the first to react.