Using HTML elements

Meta tags

Meta tags allow you to specify metadata about a site page. A number of meta tags are also used by search engine robots.

Note. Often the description and title meta tags are created automatically. They duplicate themselves and don't make the search easier for the users. Meta tags with low quality content can have negative effect on the display of the site pages in the search.

The Yandex robot looks at the content of the following meta tags:

  • <meta name="Keywords" content="..."/> — May be used when determining the page's relevance to search queries.
  • <meta name="Description" content="..."/> — The content of this tag can be used in snippets (site descriptions in search results).
  • <meta name="viewport" content="width=device-width, initial-scale=1"> — Used to adapt the site for mobile devices. It allows controlling the zoom of the viewport in the browser. The value width=device-width adapts the width of the viewport to the device screen. The value initial-scale=1 provides a 1:1 ratio of CSS pixels to independent device pixels.

    If the meta tag is omitted, mobile browsers show the page for a computer screen by default. Since the screen width on a mobile device is significantly less than a computer screen, browsers try to optimize the content by increasing the font size, scaling the content to the screen size, or showing only the part of the content that fits on the screen.

  • <meta http-equiv="Content-Type" content="type; charset=..."/> — The robot may look at this tag to determine the type of the document and its encoding.
  • <meta http-equiv="refresh" content="N;url=_redirect destination URL_"/> — Redirects the user to the page with the specified URL after the users stays N seconds on the current page. For small N values, it is considered a temporary redirect, similar to server redirects with the HTTP code 302/303/307.

The Yandex robot also looks at these meta tags:

  • <meta name="robots" content="all"/> — Allows you to index text and links on the page, similar to <meta name="robots" content="index, follow"/>.

  • <meta name="robots" content="noindex"/> — Prohibits indexing the page text.

  • <meta name="robots" content="nofollow"/> — Prohibits following the links on the page.

  • <meta name="robots" content="none"/> — Prohibits indexing the text and following the links on the page, similar to <meta name="robots" content="noindex, nofollow"/>.

  • <meta name="robots" content="noarchive"/> — Prohibits showing the link to the saved copy on the search results page.

  • <meta name="robots" content="noyaca"/>Prohibits using the automatically generated description.

In the name attribute, you can use yandex in place of robots to specify directives only for the Yandex robot. For example:
<meta name="yandex" content="all"/>

The robot doesn't visit documents if they are linked to from pages containing a nofollow meta tag. However, they may be indexed if other sources link to them without nofollow.

If meta tags aren't specified, the robot assumes that they have positive values (index, follow, archive). If the robot discovers a tag conflict, it chooses the positive value.

Example:

<meta name="robots" content="all"/>
<meta name="robots" content="noindex, follow"/>
<!-- The robot will choose the value "all", the text and the links will be indexed.-->

There is an exception — the all attribute doesn't affect noarchive:

<meta name="robots" content="all"/>
<meta name="robots" content="noarchive"/>
<!--The text and the links will be indexed, but there will be no linkto the saved copy of the page.-->

The noindex element

To prohibit indexing of auxiliary fragments of the text, use the <noindex> tag. This tag works the same way as the noindex meta tag, but it only applies to the text enclosed inside the tag in the format:

<noindex>the text you want to prohibit from indexing</noindex>

The noindex tag is not sensitive to nesting, meaning it can be placed anywhere in the HTML code of a page. You can use the tag in the following format if necessary for making the site code valid:

<!--noindex-->the text you want to prohibit from indexing <!--/noindex-->

The rel = "nofollow" attribute of the a element

The rel="nofollow" attribute is used in the <a> tag in the following format:


<a href="url" rel="nofollow">link text</a>  

The attribute works the same way as the meta tag with the nofollow value, but it only applies to the specified link.

The rel="canonical" attribute of the link element

If a site has groups of pages with similar content, the webmaster can specify the preferred (canonical) address to use in search results for each group. For example, a page can be accessed using two addresses:

www.example.com/pages?id=2www.example.com/blog

If the preferred address is /blog, this should be reflected in the page code /pages?id=2:

<link rel="canonical" href="http://www.example.com/blog"/>

Likewise, if the page has the rel="canonical" attribute specifying the address of this page, the robot regards it as canonical. This page will be indexed and will appear in the Yandex search results.

The robot doesn't treat a link with the rel="canonical" attribute as a strict directive, but as an option that is taken into account and may be ignored.

For example, the robot might not use the address you specified if:

  • The document isn't accessible for indexing at the canonical address.

  • The canonical address specifies a URL in a different domain or subdomain.

  • You specified several canonical addresses.

You also shouldn't create chains of canonical addresses. For example, for the address example.ru/1, the canonical address is example.ru/2, but at the same time, the address example.ru/2 has the canonical address example.ru/3.