# Meta element

The **meta element** (`<meta>`) is an [HTML element](https://www.edgepedia.org/html-element) that represents document-level metadata that cannot be represented by other meta-related elements such as `<base>`, `<link>`, `<script>`, `<style>`, or `<title>`.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup> It is a void element with no content, carrying its information entirely in attributes, and it is defined in section 4.2.5 of the HTML Standard maintained by WHATWG.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup><sup> • </sup><sup>[2](https://html.spec.whatwg.org/print.pdf)</sup>

| Key fact | Detail |
|---|---|
| Element type | Void element: must have a start tag, must not have an end tag, and permits no content<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup> |
| Four modes | `name` (document metadata), `http-equiv` (pragma directive), `charset` (encoding declaration), `itemprop` (user-defined metadata)<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup> |
| Charset rule | The `charset` value must be an ASCII case-insensitive match for `"utf-8"`, and the element must lie entirely within the first 1024 bytes of the document<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup> |
| Search control | The robots `meta` tag controls indexing and serving per page; `noindex` keeps a page out of Google search results<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup><sup> • </sup><sup>[4](https://developers.google.com/search/docs/crawling-indexing/control-what-you-share)</sup> |
| Origin of robots meta | Developed by the web-standards community in 1996, a few months after `meta` tags were proposed for HTML<sup>[5](https://developers.google.com/search/blog/2025/03/robots-refresher-page-level)</sup> |
| Non-HTML resources | Indexing rules for PDFs, videos, and images are delivered through the `X-Robots-Tag` HTTP response header instead<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup> |
| Deprecated uses | The `Set-Cookie` and `x-ua-compatible` pragma directives are now ignored by browsers<sup>[6](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv)</sup> |

## How the element works

A `<meta>` element operates in exactly one of four modes, determined by which attribute is present.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup>

- With the `name` attribute, the element provides document-level metadata as a name-value pair, with `content` holding the value.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup>
- With the `http-equiv` attribute, the element acts as a pragma directive, simulating instructions that could otherwise be delivered by an HTTP header; the attribute name is short for "http-equivalent".<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup>
- With the `charset` attribute, the element declares the character encoding of the document.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup>
- With the `itemprop` attribute, the element provides user-defined metadata. The `itemprop` attribute must not be set on a `<meta>` element that also has `name`, `http-equiv`, or `charset`.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup>

Placement matters for parsers. `<meta charset>` and encoding-declaration `<meta http-equiv>` elements belong in the `<head>` element, and the character encoding declaration must be serialized completely within the first 1024 bytes of the document; a document can contain only one `meta`-based encoding declaration.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup><sup> • </sup><sup>[7](https://html.spec.whatwg.org/dev/semantics.html)</sup> Google additionally warns that if an invalid element appears inside `<head>`, it assumes the end of the head and ignores any elements after it, so misplaced markup can silently discard metadata.<sup>[8](https://developers.google.com/search/docs/crawling-indexing/valid-page-metadata)</sup>

## Standard metadata names

The HTML specification defines a set of standard `name` values, and the WHATWG Wiki MetaExtensions page serves as a registry where anyone can add new metadata names.<sup>[9](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name)</sup><sup> • </sup><sup>[7](https://html.spec.whatwg.org/dev/semantics.html)</sup> The standard names include:

- `description`, a short and accurate summary of the page, often called the "meta description"; search engines use it to adjust how a page appears in results.<sup>[9](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name)</sup>
- `application-name`, `author`, `generator`, and `keywords`, the last of which is ignored by search engines because spammers filled keyword lists with hundreds of terms, biasing results.<sup>[9](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name)</sup><sup> • </sup><sup>[10](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Structuring_content/Webpage_metadata)</sup>
- `color-scheme`, which indicates compatibility and order of preference for light and dark color modes; for example `content="light dark"` states that the document prefers light mode but supports dark.<sup>[11](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/color-scheme)</sup>
- `theme-color`, which suggests a color, given as a CSS `<color>` value, that user agents should use to customize the display of the page or surrounding interface; an optional `media` attribute scopes the color to a media query.<sup>[12](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/theme-color)</sup>
- `viewport`, which gives hints about how the viewport should be sized on mobile devices.<sup>[13](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport)</sup>

The viewport value exists because mobile browsers historically rendered pages in a virtual viewport of around 980px; without the declaration, media queries that trigger at 640px or 480px would never apply, limiting responsive design. The recommended setting is `<meta name="viewport" content="width=device-width">`, which makes the viewport match the device's width.<sup>[13](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport)</sup>

## Pragma directives with http-equiv

The `http-equiv` attribute lets an author provide processing instructions as if the server had sent certain HTTP headers. Its defined values include `content-security-policy`, which sets a content security policy for the page, typically to guard against cross-site scripting; `default-style`, which names the default CSS style sheet set; and `refresh`, which reloads the page after a number of seconds or redirects to another URL given as `content="3;url=https://example.com"`.<sup>[6](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv)</sup> The HTTP `Refresh` response header is exactly equivalent to the `<meta http-equiv="refresh">` form.<sup>[14](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Refresh)</sup>

Two former uses have fallen out of service. The `Set-Cookie` pragma, which once set a cookie for the document, is now ignored by browsers in favor of the `Set-Cookie` HTTP response header or `document.cookie`; `x-ua-compatible`, used by legacy versions of the retired Microsoft Internet Explorer, is likewise ignored by user agents.<sup>[6](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv)</sup> MDN also cautions against setting other security headers through `<meta http-equiv>`, because unrecognized headers or invalid values are silently ignored, which can create a false sense of security.<sup>[6](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv)</sup>

## The robots meta tag and search engines

The best-known `name` value in practice is `robots`. The robots `meta` tag gives site owners a granular, page-specific way to control how an individual HTML page is indexed and served in search results, using rules such as `noindex`, `nofollow`, `nosnippet`, `max-snippet:[number]`, and `unavailable_after: [date/time]`, combinable in a comma-separated list.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup> The `noindex` rule tells Google not to index the content or show it in search results, though the page can still be linked to and visited directly.<sup>[4](https://developers.google.com/search/docs/crawling-indexing/control-what-you-share)</sup>

Several practical constraints shape how these rules work:

- Crawlers can follow the rules only if they are allowed to access the page. A URL disallowed by robots.txt can still be indexed if linked from elsewhere on the web, so to reliably keep a page out of results, Google recommends password protection, the `noindex` meta tag or response header, or removing the page.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup><sup> • </sup><sup>[15](https://developers.google.com/search/docs/crawling-indexing/robots/intro?authuser=117&hl=en)</sup>
- When rules conflict, the more restrictive rule applies; when multiple crawlers are addressed with different rules, the search engine applies the sum of the negative rules.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup>
- Google supports two user agent tokens in the tag, `googlebot` for all text results and `googlebot-news` for news results; other values are ignored.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup>
- Non-HTML resources such as PDF, video, and image files cannot carry a meta tag, so their rules are sent in the `X-Robots-Tag` HTTP response header, which accepts the same rules and can be set globally in Apache or NGINX configuration.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup>
- A text-level companion, the `data-nosnippet` boolean attribute on `span`, `div`, and `section` elements, excludes parts of a page from snippets.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup>

Some rules have lapsed as features disappeared: `noarchive` is no longer used because Google's cached-link feature no longer exists, and `nositelinkssearchbox` is unused because the sitelinks search box is gone.<sup>[3](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)</sup>

## Accessibility of meta refresh

Delayed `meta refresh` interacts with the [Web Content Accessibility Guidelines](https://www.edgepedia.org/web-content-accessibility-guidelines). The W3C technique H76 permits an instant client-side redirect using `http-equiv="refresh"` with a `content` value of `0` followed by the target URI, for cases where authors cannot implement a server-side redirect.<sup>[16](https://www.w3.org/WAI/WCAG22/Techniques/html/H76)</sup> The corresponding ACT rule checks that any refresh delay falls between 0 and 72000 seconds (20 hours); a zero-second refresh counts as a redirect and is exempt, while longer delays fail WCAG success criteria 2.2.1 Timing Adjustable, 2.2.4 Interruptions, and 3.2.5 Change on Request.<sup>[17](https://www.w3.org/WAI/standards-guidelines/act/rules/bc659a/)</sup> MDN notes that short refresh intervals can leave users of screen readers unable to finish reading a page before an unannounced redirect.<sup>[6](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv)</sup>

## History

The robots `meta` tag was developed by the community involved in web standards in 1996, a few months after `meta` tags were proposed for HTML and, anecdotally, before Google was founded.<sup>[5](https://developers.google.com/search/blog/2025/03/robots-refresher-page-level)</sup> The element itself is now specified in the WHATWG HTML Living Standard, and its core features have been widely available across browsers since July 2015, though individual `name` values vary in support; `theme-color`, for example, is not yet Baseline because it does not work in some widely used browsers.<sup>[1](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)</sup><sup> • </sup><sup>[12](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/theme-color)</sup>

## References

1. [`<meta>` HTML metadata element, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta)
2. [HTML Standard, section 4.2.5 The meta element, WHATWG](https://html.spec.whatwg.org/print.pdf)
3. [Robots Meta Tags Specifications, Google Search Central](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)
4. [Control the Content You Share on Search, Google Search Central](https://developers.google.com/search/docs/crawling-indexing/control-what-you-share)
5. [Robots Refresher: page-level granularity, Google Search Central Blog](https://developers.google.com/search/blog/2025/03/robots-refresher-page-level)
6. [`<meta http-equiv>` HTML attribute, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv)
7. [HTML Standard, Edition for Web Developers (semantics), WHATWG](https://html.spec.whatwg.org/dev/semantics.html)
8. [Valid Page Metadata for Google Search, Google Search Central](https://developers.google.com/search/docs/crawling-indexing/valid-page-metadata)
9. [`<meta name>` HTML attribute, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name)
10. [What's in the head? Web page metadata, MDN Learn](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Structuring_content/Webpage_metadata)
11. [`<meta name="color-scheme">` HTML attribute value, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/color-scheme)
12. [`<meta name="theme-color">` HTML attribute value, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/theme-color)
13. [`<meta name="viewport">` HTML attribute value, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport)
14. [Refresh header, HTTP, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Refresh)
15. [Robots.txt Introduction and Guide, Google Search Central](https://developers.google.com/search/docs/crawling-indexing/robots/intro?authuser=117&hl=en)
16. [H76: Using meta refresh to create an instant client-side redirect, W3C WAI](https://www.w3.org/WAI/WCAG22/Techniques/html/H76)
17. [Meta element has no refresh delay, ACT Rule, W3C WAI](https://www.w3.org/WAI/standards-guidelines/act/rules/bc659a/)

---
*Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Software and programming › Web development and web-platform technologies*

*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
