Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Block search engine indexing for website

I'm in the process of wrapping up some lessons on 'How to Build a Website'.

Since the website I built while learning is not really ready for prime time, I don't want it indexed by search engines just yet.

In a Google Support article, I read that I can include a meta tag in the <head> section of the page.

That is, add the following:

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

The code on all my HTML documents looks like this.

<head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex">
    <title> Rahi Delvi | Accidental Tech </title>

Is this right?

2 Answers

Hi Rahi, yes that is correct, you may also want to add the noindex attribute too. Another method would be to add a robots.txt file in the root of your site which needs the following in it:

User-agent: *
Disallow: /

Have a look at the following link for more info.

Great. Thanks Gareth Redfern