How to prevent search engines from indexing a sing

2019-01-17 06:42发布

I don't want the search engines to index my imprint page. How could I do that?

7条回答
太酷不给撩
2楼-- · 2019-01-17 06:58

You need a simple robots.txt file. Basically, it's a text file that tells search engines not to index particular pages.
You don't need to include it in the header of your page; as long as it's in the root directory of your website it will be picked up by crawlers.
Create it in the root folder of your website and put the following text in:

User-Agent: *
Disallow: /imprint-page.htm

Note that you'd replace imprint-page.html in the example with the actual name of the page (or the directory) that you wish to keep from being indexed.

That's it! If you want to get more advanced, you can check out here, here, or here for a lot more info. Also, you can find free tools online that will generate a robots.txt file for you (for example, here).

查看更多
叼着烟拽天下
3楼-- · 2019-01-17 06:59

Also you can add following meta tag in HEAD of that page

<meta name="robots" content="noindex,nofollow" />
查看更多
Rolldiameter
4楼-- · 2019-01-17 07:01

A robot wants to vists a Web site URL, say http://www.example.com/welcome.html. Before it does so, it firsts checks for http://www.example.com/robots.txt, and finds: you can explicitly disallow :

User-agent: *
Disallow: /~joe/junk.html

please visit below link for details robots.txt

查看更多
狗以群分
5楼-- · 2019-01-17 07:10

Nowadays, the best method is to use a robots meta tag and set it to noindex,follow:

<meta name="robots" content="noindex, follow">
查看更多
来,给爷笑一个
6楼-- · 2019-01-17 07:13
<meta name="robots" content="noindex, nofollow">

Just include this line in your <html> <head> tag. Why I'm telling you this because if you use robots.txt file to hide your URLs that might be login pages or other protected URLs that you won't show to someone else or search engines.

What I can do is just accessing the robots.txt file directly from your website and can see which URLs you have are secret. Then what is the logic behind this robots.txt file?

The good way is to include the meta tag from above and keep yourself safe from anyone.

查看更多
唯我独甜
7楼-- · 2019-01-17 07:16

Create a robots.txt file and set the controls there.

Here are the docs for google: http://code.google.com/web/controlcrawlindex/docs/robots_txt.html

查看更多
登录 后发表回答