mozilla

Revision 295758 of <meta>

  • Revision slug: HTML/Element/meta
  • Revision title: meta
  • Revision id: 295758
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

Summary

The HTML Meta Element (<meta>) represents any metadata information which cannot be represented using one of the other meta-related element ({{ HTMLElement("base") }}, {{ HTMLElement("link") }}, {{ HTMLElement("script") }}, {{ HTMLElement("style") }} or {{ HTMLElement("title") }}). According to the attributes set, the kind of metadata can be one of the following:

  • if the {{ htmlattrxref("name", "meta") }} is set, a document-level metadata, applying to the whole page;
  • if the {{ htmlattrxref("http-equiv", "meta") }} is set, a pragma directive, i.e. information given to the webserver on how the webpage should be served;
  • if the {{ htmlattrxref("charset", "meta") }} is set, a charset declaration, i.e. the charset used for the serialized-form of the webpage; {{ HTMLVersionInline(5) }}
  • if the {{ htmlattrxref("itemprop", "meta") }} is set, a user-defined metadata, transparent for the user-agent as the semantic of the metadata is user-specific.{{ HTMLVersionInline(5) }} {{ unimplemented_inline() }}

Usage context

Content categories Metadata content
Permitted content None, this is a void element.
Tag omission As it is a void element, the start tag must be present and the end tag must not be present
Permitted parent elements any element that accept metadata elements
Normative document HTML5, section 4.2.5 (HTML4.01, section 7.4.4.2)

Attributes

Like all other HTML elements, this element supports the global attributes. Note that the global {{ htmlattrxref("name", "meta") }} has a specific semantic in the {{ HTMLElement("meta") }} element and that the {{ htmlattrxref("itemprop", "meta") }} must not be set when one of the {{ htmlattrxref("name", "meta") }}, {{ htmlattrxref("http-equiv", "meta") }} or {{ htmlattrxref("charset", "meta") }} is already used.

{{ htmlattrdef("charset") }} {{ HTMLVersionInline(5) }}
This attribute declares the character encoding used of the page. It can be locally overridden using the lang attribute on any element. This attribute is a literal string and must be one of the preferred MIME name for a character encoding as defined by the IANA. Though the standard doesn't request a specific character encoding, it gives some recommendations about it:
  • Authors are encouraged to use UTF-8.
  • Authors should not use ASCII-incompatible encodings (i.e. those that don't map the 8-bit code points 0x20 to 0x7E to the Unicode 0x0020 to 0x007E code points) as these represent a security risk: browsers non supporting them may interpret benign content as HTML Elements. This is the case of at least the following charsets: JIS_C6226-1983, JIS_X0212-1990, HZ-GB-2312, JOHAB, the ISO-2022 family, and the EBCDIC family.
  • Authors must not use CESU-8, UTF-7, BOCU-1 and SCSU, also falling in that category and not intended to be used on the web. Cross-scripting attacks with some of these encodings have been documented.
  • Authors should not use UTF-32 as not all HTML 5 encoding algorithm can distinguish it from UTF-16.
Notes:
  • The declared character set must match the one of the page. It is pointless, and will lead to a poor user experience, to declare an erroneous character set.
  • This {{ HTMLElement("meta") }} element must be inside the {{ HTMLElement("head") }} element and within the 512 first bytes of the page, as some browsers only look at these first bytes before choosing a character set for the page.
  • This {{ HTMLElement("meta") }} element is only a part of the algorithm to determine the character set of a page that browsers apply. Especially, the HTTP Content-Type header and any BOM elements have precedence over this element.
  • It is good practice, and strongly recommended, to define the character set using this attribute. If no character set is defined for a page, several cross-scripting techniques may become practical to harm the page user, like the UTF-7 fallback cross-scripting technique. Always setting this meta will protect against these risks.
  • This {{ HTMLElement("meta") }} element is a synonym for the pre-HTML5 <meta http-equiv="Content-Type" content="text/html; charset=IANAcharset"> where IANAcharset corresponds of the value of the equivalent {{ htmlattrxref("charset", "meta") }} attribute. This syntax is still allowed, although obsolete and no more recommended.
{{ htmlattrdef("content") }}
This attribute gives the value associated with the {{ htmlattrxref("http-equiv", "meta") }} or {{ htmlattrxref("name", "meta") }} attribute, depending of the context.
{{ htmlattrdef("http-equiv") }}
This enumerated attribute defines the pragma that can alter servers and user-agents behavior. The value of the pragma is defined using the {{ htmlattrxref("content", "meta") }} and can be one of the following:
content-language {{ obsolete_inline() }}
This pragma defines the default language of the page.
Usage note: do not use this pragma, as it is no more recommended. Use the global lang attribute on the {{ HTMLElement("body") }} element instead.
content-type {{ obsolete_inline() }}
This attribute defines the MIME type of the document, eventually followed by its character set. It follows the same syntax as the HTTP content-type entity-header field, but as it is inside an HTML Element, most value are not possible. Therefore the valid syntax for its content is the literal string 'text/html' eventually followed by a character set with the following syntax: '; charset=IANAcharset' where IANAcharset is the preferred MIME name for a character set as defined by the IANA
Usage note:
  • Do not use this pragma, as it is no more recommended. Use the {{ htmlattrxref("charset", "meta") }} attribute on the {{ HTMLElement("meta") }} element instead.
  • As the {{ HTMLElement("meta") }} may not be used to change the type of a document in an XHTML document, or in an HTML5 document following the XHTML syntax, never set set MIME type to an XHTML MIME type that way. It would be incorrect.
  • Only HTML document can use the content-type, so most of it is redundant: that's why it has been obsoleted and replaset by the {{ htmlattrxref("charset", "meta") }} attribute.
default-style
This pragma specifies the preferred stylesheet to be used on the page. The {{ htmlattrxref("content", "meta") }} attribute must contains the id of a {{ HTMLElement("link") }} element whose {{ htmlattrxref("href", "link") }} attribute links to a CSS stylesheet, or the id of a {{ HTMLElement("style") }} element which contains a CSS stylesheet.
refresh
This pragma specifies:
  • the number of seconds until the page should be reloaded, if the {{ htmlattrxref("content", "meta") }} attribute contains only a positive integer number;
  • the number of seconds until the page should be redirected to another, if the {{ htmlattrxref("content", "meta") }} attribute contains a positive integer number followed by the string ';url=' and a valid URL.
set-cookie {{ obsolete_inline() }}
This pragma defines a cookie for the page. Its content must follows the syntax defines in the IETF HTTP Cookie Specification.
Note: Do not use this pragma as it is obsolete. Use the HTTP header set-cookie instead.
{{ htmlattrdef("name") }}
This attribute defines the name of a document-level metadata. It should not be set if one of the attribute {{ htmlattrxref("itemprop", "meta") }}, {{ htmlattrxref("http-equiv", "meta") }} or {{ htmlattrxref("charset", "meta") }} is also set.
This document-level metadata name is associated with a value, contained by the {{ htmlattrxref("content", "meta") }} attribute. The possible values for the name element are, with their associated value stored via the {{ htmlattrxref("content", "meta") }} attribute:
  • application-name, defining the name of the web application running in the webpage;
    Note:
    • Browsers may use this to identify the application. It is different from the {{ HTMLElement("title") }} element, which usually consist of  the application name but may also contain specific information like the document name or a status;
    • Simple webpages shouldn't define the application-name meta.
  • author, defining, in a free format, the name of the author of the document;
  • description, containing a short and accurate summary of the content of the page. Several browsers, among them Firefox and Opera, use this meta as the default description of the page when bookmarked;
  • generator, containing, in a free format, the identifier to the software that generated the page;
  • keywords, containing, as strings separated by commas, relevant words associated with the content of the page.

The attribute may also have a value taken from the extended list defined on WHATWG Wiki MetaExtensions page. Also none has been formally accepted yet, a few commonly used names are among the proposals:

  • creator, defining, in a free format, the name of the creator of the document. Note that it can be the name of the institution. If there are more than one, several {{ HTMLElement("meta") }} element should be used;
  • googlebot, which is a synonym of robots, but is only followed by Googlebot, the indexing crawler for Google;
  • publisher, defining, in a free format, the name of the publisher of the document. Note that it can be the name of the institution;
  • robots, defining the behavior that cooperative crawlers should have with the page. It is a comma-separated list of values taken in the following list:
    Values for the content of <meta name="robots">
    Value Description Used by
    index Allows the robot to index the page All
    noindex Prevents the robot to index the page All
    follow Allows the robot to follow the links on the page All
    nofollow Prevents the robot to follow the links on the page All
    noodp Prevents the usage of the Open Directory Project description, if any, as the description of the page in the search engine results page

    Google, Yahoo, Bing

    noarchive Prevents the search engine to cache the content of the page Google, Yahoo
    nosnippet Prevents the display of any description of the page in the search engine results page Google
    noimageindex Prevents this page to appear as the referring page of an indexed image Google
    noydir Prevents the usage of the Yahoo Directory description, if any, as the description of the page in the search engine results page Yahoo
    nocache Synonym of noarchive Bing
    Notes:
    • Only cooperative robots will follow the rules defined by the robots name. Do not expect to keep e-mail harvesters at bay with this
    • The robot still needs to access the page in order to read the meta value. If you want to keep them at bay, for example to prevent bandwidth consumption, use a robots.txt file instead (or in complement).
    • If you want to remove the page of an index, changing the meta to noindex will work, but only when the robot visit the page again. Be sure not to prevent such visit, via the robots.txt file for example. Some search engines have developers tools allowing a quick removal of some page.
    • Some possible values are mutually exclusive, like using index and noindex, or follow and nofollow, at the same time. In these case the behavior of the robot is undefined, and may vary from one to the other. So avoid these cases.
    • Some search engine crawler robots, like those of Google, Yahoo Search or Bing, supports the same values on an HTTP directive, X-Robot-Tags: this allows to use these pragma on non-HTML documents, like images.
  • slurp, which is a synonym of robots, but is only followed by Slurp, the indexing crawler for Yahoo Search;

Finally a few names are in common use, though not in progress of being standardized:

  • viewport, which gives hints about the size of the initial size of the viewport. This pragma is used by several mobile devices only.
    Values for the content of <meta name="viewport">
    Value Possible values Description
    width a positive integer number or the literal device-width defines the width, in pixels, of the viewport
    height a positive integer number of the literal device-height defines the height, in pixels, of the viewport
    initial-scale a positive number between 0.0 and 10.0 defines the ratio between the device width (device-width in portrait mode or device-height in landscape mode) and the viewport size.e
    maximum-scale a positive number between 0.0 and 10.0 defines the maximum value of the zoom; it must be greater or equal to the minimum-scale or the behavior is underterminate.
    minimum-scale a positive number between 0.0 and 10.0 defines the minimum value of the zoom; it must be smaller or equal to the maximum-scale or the behavior is undeterminate.
    user-scalable a boolean value (yes or no) If set to no, the user is not able to zoom or in the webpage. Default value is yes.
    Notes:
    • Though not standardized, this attribute is used by different mobile browsers like Safari Mobile, Firefox for Mobile or Opera Mobile.
    • The default values may change from one device, and browser, to another
    • To learn about this pragma in Firefox for Mobile, see this article.
{{ htmlattrdef("scheme") }} {{ obsolete_inline() }}
This attribute defines the scheme in which the metadata is described. A scheme is a context leading to the correct interpretations of the {{ htmlattrxref("content", "meta") }} value, like a format.
Notes: Do not use this attribute as it has been deprecated. There is no replacement for it as there was no real usage for it. Omit it altogether.

DOM interface

This element implements the HTMLMetaElement interface.

Examples

<!-- Defining the charset in HTML4 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<!-- In HTML5 -->
<meta charset="utf-8">

<!-- Redirect page after 3 seconds -->
<meta http-equiv="refresh" content="3;url=http://www.mozilla.org/">

See also

  • The other elements containing metadata: {{ HTMLElement("base") }}, {{ HTMLElement("head") }}, {{ HTMLElement("link") }}, {{ HTMLElement("style") }},{{ HTMLElement("title") }}.

Revision Source

<h2 id="Summary">Summary</h2>
<p>The <em>HTML Meta Element</em> (<code>&lt;meta&gt;</code>) represents any metadata information which cannot be represented using one of the other meta-related element ({{ HTMLElement("base") }}, {{ HTMLElement("link") }}, {{ HTMLElement("script") }}, {{ HTMLElement("style") }} or {{ HTMLElement("title") }}). According to the attributes set, the kind of metadata can be one of the following:</p>
<ul>
  <li>if the {{ htmlattrxref("name", "meta") }} is set, <em>a document-level</em> <em>metadata</em>, applying to the whole page;</li>
  <li>if the {{ htmlattrxref("http-equiv", "meta") }} is set, <em>a pragma directive</em>, i.e. information given to the webserver on how the webpage should be served;</li>
  <li>if the {{ htmlattrxref("charset", "meta") }} is set, <em>a charset declaration</em>, i.e. the charset used for the serialized-form of the webpage; {{ HTMLVersionInline(5) }}</li>
  <li>if the {{ htmlattrxref("itemprop", "meta") }} is set, a <em>user-defined metadata</em>, transparent for the user-agent as the semantic of the metadata is user-specific.{{ HTMLVersionInline(5) }} {{ unimplemented_inline() }}</li>
</ul>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <td><a href="/en/HTML/Content_categories" title="en/HTML/Content categories">Content categories</a></td>
      <td>Metadata content</td>
    </tr>
    <tr>
      <td>Permitted content</td>
      <td>None, this is a void element.</td>
    </tr>
    <tr>
      <td>Tag omission</td>
      <td>As it is a void element, the <span title="syntax-start-tag">start tag</span> must be present and the <span title="syntax-end-tag">end tag</span> must not be present</td>
    </tr>
    <tr>
      <td>Permitted parent elements</td>
      <td>any element that accept metadata elements</td>
    </tr>
    <tr>
      <td>Normative document</td>
      <td><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#meta" rel="external nofollow" target="_blank" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#meta">HTML5, section 4.2.5</a> (<a class="external" href="http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.4.2" title="http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.4.2">HTML4.01, section 7.4.4.2</a>)</td>
    </tr>
  </tbody>
</table>
<h2 id="Attributes">Attributes</h2>
<p>Like all other HTML&nbsp;elements, this element supports the <a href="/en/HTML/Global_attributes" title="en/HTML/Global attributes">global attributes</a>. Note that the global {{ htmlattrxref("name", "meta") }} has a specific semantic in the {{ HTMLElement("meta") }} element and that the {{ htmlattrxref("itemprop", "meta") }} must not be set when one of the {{ htmlattrxref("name", "meta") }}, {{ htmlattrxref("http-equiv", "meta") }} or {{ htmlattrxref("charset", "meta") }} is already used.</p>
<dl>
  <dt>
    {{ htmlattrdef("charset") }} {{ HTMLVersionInline(5) }}</dt>
  <dd>
    This attribute declares the character encoding used of the page. It can be locally overridden using the <strong>lang</strong> attribute on any element. This attribute is a literal string and must be one of the <em>preferred MIME name</em> for a character encoding as <a class="external" href="http://www.iana.org/assignments/character-sets" title="http://www.iana.org/assignments/character-sets">defined by the IANA</a>. Though the standard doesn't request a specific character encoding, it gives some recommendations about it:
    <ul>
      <li>Authors are encouraged to use UTF-8.</li>
      <li>Authors should not use ASCII-incompatible encodings (i.e. those that don't map the 8-bit code points 0x20 to 0x7E to the Unicode 0x0020 to 0x007E code points) as these represent a security risk: browsers non supporting them may interpret benign content as HTML&nbsp;Elements. This is the case of at least the following charsets: JIS_C6226-1983, JIS_X0212-1990, HZ-GB-2312, JOHAB, the ISO-2022 family, and the EBCDIC family.</li>
      <li>Authors must not use CESU-8, UTF-7, BOCU-1 and SCSU, also falling in that category and not intended to be used on the web. Cross-scripting attacks with some of these encodings have been documented.</li>
      <li>Authors should not use UTF-32 as not all HTML 5 encoding algorithm can distinguish it from UTF-16.</li>
    </ul>
    <div class="note">
      <strong>Notes:</strong>
      <ul>
        <li>The declared character set must match the one of the page. It is pointless, and will lead to a poor user experience, to declare an erroneous character set.</li>
        <li>This {{ HTMLElement("meta") }} element must be inside the {{ HTMLElement("head") }} element and <strong>within the 512 first bytes</strong> of the page, as some browsers only look at these first bytes before choosing a character set for the page.</li>
        <li>This {{ HTMLElement("meta") }} element is only a part of the <a href="/en/Algorithm_charset_page" title="en/Algorithm charset page">algorithm to determine the character set</a> of a page that browsers apply. Especially, the HTTP&nbsp;Content-Type header and any BOM&nbsp;elements have precedence over this element.</li>
        <li>It is good practice, and strongly recommended, to define the character set using this attribute. If no character set is defined for a page, several cross-scripting techniques may become practical to harm the page user, like the <a class="external" href="http://code.google.com/p/doctype/wiki/ArticleUtf7" title="http://code.google.com/p/doctype/wiki/ArticleUtf7">UTF-7&nbsp;fallback cross-scripting technique</a>. Always setting this meta will protect against these risks.</li>
        <li>This {{ HTMLElement("meta") }} element is a synonym for the pre-HTML5 <code>&lt;meta&nbsp;http-equiv="Content-Type" content="text/html;&nbsp;charset=<em>IANAcharset</em>"&gt; </code>where <em><span style="font-family: Courier New;">IANAcharset</span> </em>corresponds of the value of the equivalent {{ htmlattrxref("charset", "meta") }} attribute. This syntax is still allowed, although obsolete and no more recommended.</li>
      </ul>
    </div>
  </dd>
  <dt>
    {{ htmlattrdef("content") }}</dt>
  <dd>
    This attribute gives the value associated with the {{ htmlattrxref("http-equiv", "meta") }} or {{ htmlattrxref("name", "meta") }} attribute, depending of the context.</dd>
  <dt>
    {{ htmlattrdef("http-equiv") }}</dt>
  <dd>
    This enumerated attribute defines the pragma that can alter servers and user-agents behavior. The value of the pragma is defined using the {{ htmlattrxref("content", "meta") }} and can be one of the following:
    <dl>
      <dt>
        content-language {{ obsolete_inline() }}</dt>
      <dd>
        This pragma defines the default language of the page.
        <div class="note">
          <strong>Usage note:</strong> do not use this pragma, as it is no more recommended. Use the global <strong>lang</strong> attribute on the {{ HTMLElement("body") }} element instead.</div>
      </dd>
      <dt>
        content-type {{ obsolete_inline() }}</dt>
      <dd>
        This attribute defines the <a href="/en/MIME" title="en/MIME">MIME type</a> of the document, eventually followed by its character set. It follows the same syntax as the HTTP <span style="font-family: Courier New;">content-type</span> entity-header field, but as it is inside an HTML&nbsp;Element, most value are not possible. Therefore the valid syntax for its content is the literal string '<span style="font-family: Courier New;">text/html</span>' eventually followed by a character set with the following syntax:&nbsp;'<span style="font-family: Courier New;">; charset=</span><em><span style="font-family: Courier New;">IANAcharset</span></em>' where <span style="font-family: Courier New;">IANAcharset</span> is the <em>preferred MIME name</em> for a character set as <a class="external" href="http://www.iana.org/assignments/character-sets" title="http://www.iana.org/assignments/character-sets">defined by the IANA</a>
        <div class="note">
          <strong>Usage note:</strong>
          <ul>
            <li>Do not use this pragma, as it is no more recommended. Use the {{ htmlattrxref("charset", "meta") }} attribute on the {{ HTMLElement("meta") }} element instead.</li>
            <li>As the {{ HTMLElement("meta") }} may not be used to change the type of a document in an XHTML document, or in an HTML5 document following the XHTML syntax, never set set MIME&nbsp;type to an XHTML MIME type that way. It would be incorrect.</li>
            <li>Only HTML document can use the content-type, so most of it is redundant: that's why it has been obsoleted and replaset by the {{ htmlattrxref("charset", "meta") }} attribute.</li>
          </ul>
        </div>
      </dd>
      <dt>
        default-style</dt>
      <dd>
        This pragma specifies the preferred stylesheet to be used on the page. The {{ htmlattrxref("content", "meta") }} attribute must contains the <strong>id</strong> of a {{ HTMLElement("link") }} element whose {{ htmlattrxref("href", "link") }} attribute links to a CSS stylesheet, or the <strong>id</strong> of a {{ HTMLElement("style") }} element which contains a <a href="/en/CSS" title="en/CSS">CSS</a> stylesheet.</dd>
      <dt>
        refresh</dt>
      <dd>
        This pragma specifies:
        <ul>
          <li>the number of seconds until the page should be reloaded, if the {{ htmlattrxref("content", "meta") }} attribute contains only a positive integer number;</li>
          <li>the number of seconds until the page should be redirected to another, if the {{ htmlattrxref("content", "meta") }} attribute contains a positive integer number followed by the string '<code>;url=</code>' and a valid URL.</li>
        </ul>
      </dd>
      <dt>
        set-cookie {{ obsolete_inline() }}</dt>
      <dd>
        This pragma defines a <a href="/en/cookie" title="en/cookie">cookie</a> for the page. Its content must follows the syntax defines in the <a class="external" href="http://tools.ietf.org/html/draft-ietf-httpstate-cookie-14" title="http://tools.ietf.org/html/draft-ietf-httpstate-cookie-14">IETF HTTP&nbsp;Cookie Specification</a>.
        <div class="note">
          <strong>Note:</strong> Do not use this pragma as it is obsolete. Use the HTTP header set-cookie instead.</div>
      </dd>
    </dl>
  </dd>
  <dt>
    {{ htmlattrdef("name") }}</dt>
  <dd>
    This attribute defines the name of a document-level metadata. It should not be set if one of the attribute {{ htmlattrxref("itemprop", "meta") }}, {{ htmlattrxref("http-equiv", "meta") }} or {{ htmlattrxref("charset", "meta") }} is also set.<br />
    This document-level metadata name is associated with a value, contained by the {{ htmlattrxref("content", "meta") }} attribute. The possible values for the name element are, with their associated value stored via the {{ htmlattrxref("content", "meta") }} attribute:
    <ul>
      <li><span style="font-family: Courier New;">application-name</span>, defining the name of the web application running in the webpage;
        <div class="note">
          <strong>Note:</strong><br />
          <ul>
            <li>Browsers may use this to identify the application. It is different from the {{ HTMLElement("title") }} element, which usually consist of&nbsp; the application name but may also contain specific information like the document name or a status;</li>
            <li>Simple webpages shouldn't define&nbsp;the application-name meta.</li>
          </ul>
        </div>
      </li>
      <li><span style="font-family: Courier New;">author</span>, defining, in a free format, the name of the author of the document;</li>
      <li><span style="font-family: Courier New;">description</span>, containing a short and accurate summary of the content of the page. Several browsers, among them Firefox and Opera, use this meta as the default description of the page when bookmarked;</li>
      <li><span style="font-family: Courier New;">generator</span>, containing, in a free format, the identifier to the software that generated the page;</li>
      <li><span style="font-family: Courier New;">keywords</span>, containing, as strings separated by commas, relevant words associated with the content of the page.</li>
    </ul>
    <p>The attribute may also have a value taken from the extended list defined on <a class="external" href="http://wiki.whatwg.org/wiki/MetaExtensions" title="http://wiki.whatwg.org/wiki/MetaExtensions">WHATWG Wiki MetaExtensions page</a>. Also none has been formally accepted yet, a few commonly used names are among the proposals:</p>
    <ul>
      <li><span style="font-family: Courier New;">creator</span>, defining, in a free format, the name of the creator of the document. Note that it can be the name of the institution. If there are more than one, several {{ HTMLElement("meta") }} element should be used;</li>
      <li><span style="font-family: Courier New;">googlebot</span>, which is a synonym of <span style="font-family: Courier New;">robots</span>, but is only followed by Googlebot, the indexing crawler for Google;</li>
      <li><span style="font-family: Courier New;">publisher</span>, defining, in a free format, the name of the publisher of the document. Note that it can be the name of the institution;</li>
      <li><span style="font-family: Courier New;">robots</span>, defining the behavior that cooperative crawlers should have with the page. It is a comma-separated list of values taken in the following list:
        <table class="standard-table">
          <caption>
            Values for the content of &lt;meta name="robots"&gt;</caption>
          <thead>
            <tr>
              <th scope="col">Value</th>
              <th scope="col">Description</th>
              <th scope="col">Used by</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td><span style="font-family: Courier New;">index</span></td>
              <td>Allows the robot to index the page</td>
              <td>All</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">noindex</span></td>
              <td>Prevents the robot to index the page</td>
              <td>All</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">follow</span></td>
              <td>Allows the robot to follow the links on the page</td>
              <td>All</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">nofollow</span></td>
              <td>Prevents the robot to follow the links on the page</td>
              <td>All</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">noodp</span></td>
              <td>Prevents the usage of the <a class="external" href="http://www.dmoz.org/" title="http://www.dmoz.org/">Open Directory Project</a> description, if any, as the description of the page in the search engine results page</td>
              <td>
                <p><a class="external" href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812" title="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812">Google</a>, <a class="external" href="http://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html;_ylt=Arh3LHnisvRMPJKzQqmJ97JYqCN4" title="http://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html;_ylt=Arh3LHnisvRMPJKzQqmJ97JYqCN4">Yahoo</a>, <a class="external" href="http://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx" title="http://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx">Bing</a></p>
              </td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">noarchive</span></td>
              <td>Prevents the search engine to cache the content of the page</td>
              <td><a class="external" href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812" title="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812">Google</a>, <a class="external" href="http://help.yahoo.com/l/us/yahoo/search/indexing/basics-10.html;_ylt=Aszma_Ly8TfhL7mn_LGWn5RYqCN4" title="http://help.yahoo.com/l/us/yahoo/search/indexing/basics-10.html;_ylt=Aszma_Ly8TfhL7mn_LGWn5RYqCN4">Yahoo</a></td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">nosnippet</span></td>
              <td>Prevents the display of any description of the page in the search engine results page</td>
              <td><a class="external" href="http://www.google.com/support/webmasters/bin/answer.py?answer=35304" title="http://www.google.com/support/webmasters/bin/answer.py?answer=35304">Google</a></td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">noimageindex</span></td>
              <td>Prevents this page to appear as the referring page of an indexed image</td>
              <td><a class="external" href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812" title="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812">Google</a></td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">noydir</span></td>
              <td>Prevents the usage of the Yahoo Directory description, if any, as the description of the page in the search engine results page</td>
              <td><a class="external" href="http://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html;_ylt=Arh3LHnisvRMPJKzQqmJ97JYqCN4" title="http://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html;_ylt=Arh3LHnisvRMPJKzQqmJ97JYqCN4">Yahoo</a></td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">nocache</span></td>
              <td>Synonym of <span style="font-family: Courier New;">noarchive</span></td>
              <td><a class="external" href="http://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx" title="http://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx">Bing</a></td>
            </tr>
          </tbody>
        </table>
        <div class="note">
          <strong>Notes:</strong>
          <ul>
            <li>Only cooperative robots will follow the rules defined by the robots name. Do not expect to keep e-mail harvesters at bay with this</li>
            <li>The robot still needs to access the page in order to read the meta value. If you want to keep them at bay, for example to prevent bandwidth consumption, use a <em><a href="/en/Robot_Exclusion_Protocol" title="en/Robot Exclusion Protocol">robots.txt</a></em> file instead (or in complement).</li>
            <li>If you want to remove the page of an index, changing the meta to <span style="font-family: Courier New;">noindex</span> will work, but only when the robot visit the page again. Be sure not to prevent such visit, via the <em>robots.txt</em> file for example. Some search engines have developers tools allowing a quick removal of some page.</li>
            <li>Some possible values are mutually exclusive, like using <span style="font-family: Courier New;">index</span> and <span style="font-family: Courier New;">noindex</span>, or <span style="font-family: Courier New;">follow</span> and <span style="font-family: Courier New;">nofollow</span>, at the same time. In these case the behavior of the robot is undefined, and may vary from one to the other. So avoid these cases.</li>
            <li>Some search engine crawler robots, like those of Google, Yahoo&nbsp;Search or Bing, supports the same values on an HTTP directive, <span style="font-family: Courier New;">X-Robot-Tags</span>: this allows to use these pragma on non-HTML documents, like images.</li>
          </ul>
        </div>
      </li>
      <li><span style="font-family: Courier New;">slurp</span>, which is a synonym of <span style="font-family: Courier New;">robots</span>, but is only followed by Slurp, the indexing crawler for Yahoo Search;</li>
    </ul>
    <p>Finally a few names are in common use, though not in progress of being standardized:</p>
    <ul>
      <li><span style="font-family: Courier New;">viewport</span>, which gives hints about the size of the initial size of the <a href="/en/viewport" title="en/viewport">viewport</a>. This pragma is used by several mobile devices only.
        <table class="standard-table" style="width: 1080px; height: 235px;">
          <caption>
            Values for the content of &lt;meta name="viewport"&gt;</caption>
          <thead>
            <tr>
              <th scope="col">Value</th>
              <th scope="col">Possible values</th>
              <th scope="col">Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td><span style="font-family: Courier New;">width</span></td>
              <td>a positive integer number or the literal <span style="font-family: Courier New;">device-width</span></td>
              <td>defines the width, in pixels, of the viewport</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">height</span></td>
              <td>a positive integer number of the literal <span style="font-family: Courier New;">device-height</span></td>
              <td>defines the height, in pixels, of the viewport</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">initial-scale</span></td>
              <td>a positive number between <span style="font-family: Courier New;">0.0</span> and <span style="font-family: Courier New;">10.0</span></td>
              <td>defines the ratio between the device width (<span style="font-family: Courier New;">device-width</span> in portrait mode or <span style="font-family: Courier New;">device-height</span> in landscape mode) and the viewport size.e</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">maximum-scale</span></td>
              <td>a positive number between <span style="font-family: Courier New;">0.0</span> and <span style="font-family: Courier New;">10.0</span></td>
              <td>defines the maximum value of the zoom; it must be greater or equal to the <span style="font-family: Courier New;">minimum-scale</span> or the behavior is underterminate.</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">minimum-scale</span></td>
              <td>a positive number between <span style="font-family: Courier New;">0.0</span> and <span style="font-family: Courier New;">10.0</span></td>
              <td>defines the minimum value of the zoom; it must be smaller or equal to the <span style="font-family: Courier New;">maximum-scale</span> or the behavior is undeterminate.</td>
            </tr>
            <tr>
              <td><span style="font-family: Courier New;">user-scalable</span></td>
              <td>a boolean value (<span style="font-family: Courier New;">yes</span> or <span style="font-family: Courier New;">no</span>)</td>
              <td>If set to <span style="font-family: Courier New;">no</span>, the user is not able to zoom or in the webpage. Default value is <span style="font-family: Courier New;">yes</span>.</td>
            </tr>
          </tbody>
        </table>
        <div class="note">
          <strong>Notes:</strong>
          <ul>
            <li>Though not standardized, this attribute is used by different mobile browsers like Safari Mobile, Firefox for Mobile or Opera Mobile.</li>
            <li>The default values may change from one device, and browser, to another</li>
            <li>To learn about this pragma in Firefox for Mobile, see&nbsp;<a href="/en/Mobile/Viewport_meta_tag" title="en/Mobile/Viewport meta tag">this article</a>.</li>
          </ul>
        </div>
      </li>
    </ul>
  </dd>
  <dt>
    {{ htmlattrdef("scheme") }} {{ obsolete_inline() }}</dt>
  <dd>
    This attribute defines the scheme in which the metadata is described. A scheme is a context leading to the correct interpretations of the {{ htmlattrxref("content", "meta") }} value, like a format.<br />
    <div class="note">
      <strong>Notes:</strong> Do not use this attribute as it has been deprecated. There is no replacement for it as there was no real usage for it. Omit it altogether.</div>
  </dd>
</dl>
<h2 id="DOM.C2.A0interface">DOM&nbsp;interface</h2>
<p>This element implements the <a href="/en/DOM/HTMLMetaElement" title="en/DOM/HTMLMetaElement">HTMLMetaElement</a> interface.</p>
<h2 id="Examples">Examples</h2>
<pre class="brush: html">
&lt;!-- Defining the charset in HTML4 --&gt;
&lt;<span class="start-tag">meta</span><span class="attribute-name"> http-equiv</span>=<span class="attribute-value">"Content-Type" </span><span class="attribute-name">content</span>=<span class="attribute-value">"text/html; charset=utf-8"</span>&gt;

&lt;!-- In HTML5 --&gt;
&lt;<span class="start-tag">meta</span><span class="attribute-name"> charset</span>=<span class="attribute-value">"utf-8"</span>&gt;

&lt;!-- Redirect page after 3 seconds --&gt;
&lt;meta http-equiv="refresh" content="3;url=http://www.mozilla.org/"&gt;

</pre>
<h2 id="See_also">See also</h2>
<ul>
  <li>The other elements containing metadata: {{ HTMLElement("base") }}, {{ HTMLElement("head") }}, {{ HTMLElement("link") }}, {{ HTMLElement("style") }},{{ HTMLElement("title") }}.</li>
</ul>
Revert to this revision