Stop Google from indexing a page

Stopping search engines from indexing your site or one of your pages is simple with this short code-snippet:

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

Following W3C standards make sure you place the above into the <head> of your page document for the tag to be read.

If you only want to block Google but allow other search engines to index your page you can use this snippet instead:

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


If you don't want to, or don't have the ability to change the meta tags in your code, you can also block individual pages using a robots.txt file. Robots.txt should be placed in the root of your site for robots to notice it (e.g. inside public_html).

Block a specific file or url

User-agent: *
Disallow: /specific-file.html
Disallow: /specific/url

You can also block an entire directory by adding a forward slash to the end like so:

Disallow: /specific-directory/

Block images from Google Images

To block images specifically from 'Google Images' use the following:

User-agent: Googlebot-Image Disallow: /images/specific-image.jpg

To block all images:

User-agent: Googlebot-Image
Disallow: /

Block specific file types

 It's also possible to blog files by their type using:

Disallow: /*.jpg$

Pattern Matching

Some search engines (including Google) also support pattern matching. This allows you to ignore a specific range of files or pages, for example:

Disallow: /ignore*/

This will ignore any folder paths that start with 'ignore'.

Sign Up
comments powered by Disqus

Popular Tags

Need a web developer?

If you'd like to work with code synthesis on your next project get in touch via the contact page.