The Web Design Group

META - Metadata

Syntax <META>
Attribute Specifications
Contents Empty
Contained in HEAD

The META element provides metadata such as a document's keywords, description, and author. Any number of META elements may be contained in the HEAD of a document.

META's NAME attribute provides a property name while the CONTENT attribute gives the corresponding value. The CONTENT attribute value may contain text and entities, but it may not contain HTML tags.

The optional SCHEME attribute gives the format of the property value. For example, a date property may require SCHEME="Month-Day-Year" to disambiguate the date from other formats such as SCHEME="Day-Month-Year".

There is no standard list of META properties, so authors may define whatever metadata they like. The following example defines the author of the document:

<META NAME=author CONTENT="Liam Quinn">

Some search engines use keywords and description properties, giving extra weight to a document's keywords and providing its description with the link to the document. Example:

<META NAME="description" CONTENT="A description of HTML 4.0's META element for metadata.">
<META NAME="keywords" CONTENT="META, meta element, metadata, metainformation, meta data, meta information, keywords, description, refresh, HyperText Markup Language, HTML, HTML4, HTML 4.0, Web Design Group, WDG, &lt;meta&gt; tag, &lt;META&gt; tag">

To avoid being truncated by search engines, the description should be brief--no more than 200 characters. Keywords are separated by commas and may be considered case sensitive by search engines. If the same keywords are repeated too often in the META element, some search engines will not index the document. Search engines typically only process the first 1000 characters of the keywords list.

Some search engines also support the robots property for indicating whether a document should be indexed and whether its links should be followed. The associated CONTENT value is a comma-separated list of case-insensitive directives:

For example, the following META element tells search engines and other robots not to index the page but to follow links on it:

<META NAME=robots CONTENT="noindex,follow">

The HTTP-EQUIV attribute may be used in place of the NAME attribute to indicate that the property should be treated as an HTTP header. Examples:

<META HTTP-EQUIV=Expires CONTENT="Thu, 29 Nov 2007 16:18:42 GMT">
sets the expiry date of the document. For proxy caches to honor the expiry date, a real HTTP header should be used instead of a META element. Consult a caching tutorial for details.
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
sets the client-side scripting language for inline scripts to JavaScript.
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
sets the style language for inline styles to CSS.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS">
sets the character encoding for the document to Shift_JIS (a Japanese encoding).
<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.htmlhelp.com/">
tells the browser to load http://www.htmlhelp.com/ 10 seconds after the current document has finished loading. Not all browsers support this, so authors should provide an alternate means of moving to the new page where necessary. The Refresh header is sometimes used for "splash screens" or when a page has moved, but the technique is not very effective since users may not even be looking at the window that is to be refreshed. Some search engines penalize pages that use a Refresh of a few seconds or less.

More Information