Sometimes, your web site might contain pages that you do not want to see in Google’s search results. Some people block Google without knowing it and others don’t know how to exclude individual pages. This week’s article shows you how to prevent Google from indexing pages of your website.
1. Block pages and directories with the robots.txt file
The disallow directive of the robots.txt file is an easy way to exclude single files or whole directories from indexing. To exclude individual files, add this to your robots.txt file:
To exclude whole directories, use this:
If you use this method, double check your robots.txt file to make sure that you do not exclude directories that you want to see in Google’s search results.
Note that your website visitors still can see the pages that you exclude in the robots.txt file.
2. Block individual pages with the meta robots noindex tag
The meta robots noindex tag enables you to tell search engine robots that a particular page should not be indexed. To exclude a web page from the search results, add the following code in the <head> section of a web page:
In this case, search engines won’t index the page and they also won’t follow the links on the page. If you want search engines to follow the links on the page, use this tag:
The meta robots noindex tag only influences search engine robots. Regular visitors of your website still can see the pages.
3. Block pages with the correct server header status
The server header status code enables you to send real website visitors and search engine robots to different places on your website. A web page usually has a “200 OK” status code. For example, you can use these server status codes:
- 301 moved permanently: this request and all future requests should be sent to a new URL.
- 403 forbidden: the server refuses to respond to the request.
For search engine optimization purposes, a 301 redirect should be used if you want to make sure that visitors of old pages get redirected to the new pages on your website.
4. Password protect your web pages
If you password protect your pages, only visitors who know the password will be able to view the content.
Search engine robots won’t be able to access the pages. Password protected pages can have a negative influence on the user experience so you should thoroughly test this. Details on how to password protect a page can be found here.
Blocking Google can be helpful for some pages. In general, you want Google to index page pages. The tools in SEOprofiler help you to make sure that Google and other search engines can index your web pages correctly.
If you haven’t done it yet, create your SEOprofiler account now. If you want to save time, order the full version for our special price:
Article by Axandra SEO software
This article has been contributed by another writer, blogger or website. The content is their copyright and represents their views.