How To Close A Link In

Table of contents:

How To Close A Link In
How To Close A Link In
Anonim

Working on the search engine optimization of his site, a webmaster is often faced with the need to hide some of the links of any of the pages from search robots. There are several ways to do this.

Optimizing links
Optimizing links

Instructions

Step 1

One way to let the crawler (crawler) know that it shouldn't follow this link is to add a rel attribute to the link tag containing the value "nofollow". That is, if the link in its original form looks, for example, like this: You cannot go there! Then with a masking additive it must be written like this: You cannot go there!

Step 2

Option two: Noindex. For some time now, Yandex crawlers stopped responding to the "nofollow" directive and, to restore controllability of obstinate robots, webmasters began to use the "noindex" tag. In this way, you can mask not only one link, but also the text or any other page elements that are inside the opening and closing noindex tags. An example with the same link is the original variant: You can't go there! Variant masked with the noindex tag:

You can't go there!

Step 3

Option three: Nofollow + Noindex. You can combine these two methods - after all, the robots of other search engines still take nofollow into account. That is, add the rel attribute with the value "nofollow" to the link, and place the link itself inside the noindex tag. The link from the previous examples in this version will look like this:

You can't go there!

Step 4

Option four: PHP script. In order not to depend on the constantly transforming rules of search engines, you can change the principle of camouflage itself - not to place signposts for robots in the html text of the page, but to build a "transfer station" and send all links there. That is, you need to make a php-page on your site and direct the necessary links to it, adding a mark about where this link should actually lead. The script contained in the php page will read the address and send the visitor to the destination. Since the script page itself will not contain any links, nothing will be added to the indexing process. A link to such an intermediate php script will look like this: You can't go there! In this example, site.ru is the name of your site, and trans.php is the name of the php script. The script itself is very simple: <? Php

Header ("Location:". $ _ GET ['ste']); exit ();

?> You can write it in any text editor, such as notepad. The only but very important condition is that there should be nothing in front of the very first code icon (<)! No space, no line, no text … Save the document with the name trans.php and upload it to your site server. If you are doing search engine optimization, then in the root folder there should be a file named robots.txt. In it, after the line: user-agent: *, add the line: Disallow: /trans.php to disable indexing of this intermediate page.

Recommended: