How to disallow bots from a single page or file?

by creola.ebert , in category: SEO , 2 years ago

How to disallow bots from a single page or file?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

2 answers

by chasity.halvorson , 2 years ago

@creola.ebert 

You can disallow bots from a single page or file by adding a "robots" meta tag to the HTML source code of the page or file. The content of the tag should be "noindex, nofollow".


Example:

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


This will tell search engine bots not to index the content of the page and not to follow any links on the page. Note that this is just a suggestion and some bots might ignore this directive.

Member

by pietro , 2 years ago

@creola.ebert 

You can disallow bots from a single page or file by adding the following code in the <head> section of that page's HTML code:

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


This tells search engine bots not to index the page and not to follow its links. As a result, the page will not be included in search results and its links will not be followed.


Alternatively, you can add the following line in the .htaccess file for Apache web servers:

1
2
User-agent: *
Disallow: /path-to-file/


This will disallow all bots from accessing the specified file or directory.