What meta tags are available?
Meta tags provide a means of adding extra information about your HTML document. This is information that either your browser might be able to make use of or typically to provide additional information to search engines.
There are two types of meta tags:
<meta name="tag" content="data">
and
<meta http-equiv="tag" content="data">
Information provided by http-equiv
is passed to the browser before
it receives the rest of the document. It provides information that could therefore
affect how the browser handles the document. Both styles of meta tags must be positioned
within the head of the document (i.e. between the <head>
and
</head>
tags).
META NAME tags
Meta name tag | Description | ||
---|---|---|---|
Author | The name of the author of the page. | ||
Copyright | Allows a copyright statement to be embedded. | ||
Description | A short description of the page. Used by search engines as a summary
description of the page. It is generally recommended to keep the meta-description to no more than 150 characters, anything longer risks it being truncated by a search engine. However the exact length limit will vary between search engines. If you need to include double quotes in the description then escape them, for example: <meta name="description" content="A "cool"
tip"> gives the description: A "cool" tip |
||
Generator | The name of the tool used to create the page. (Unsure how useful this is to web-authors.) | ||
Keywords | Used by search engines to index the page. Use to specify keywords of relevance to the page. | ||
Robots | Gives instructions to web-robots (also called web-bots). Be aware that
the web-bot is free to ignore it! The CONTENT portion should
be a comma separated list of one or more of the following:
For example to prevent a page from being indexed: <meta name="robots" content="noindex"> these tags can be combined so, for example, to prevent a page from being indexed and any links followed: <meta name="robots" content="noindex, nofollow"> In addition there are some robots options which are recognised only by specific search engines. The following (by its nature) may not be complete:
|
In addition to the above set of "standard" meta name tags, there are some which are recognised only by specific search engine bots. The following list may is not complete but does include the most significant bots:
Meta name tag | Used by | Description |
---|---|---|
googlebot | Use the same settings as for name="robots", but applied only to the google-bot. | |
slurp | Yahoo! | Use the same settings as for name="robots", but applied only to the Yahoo bot - which is called "Slurp".. |
msnbot | MSN, Live Search, Bing | Use the same settings as for name="robots", but applied only to the Microsoft Msn-Bot, which in turn feeds into MSN, Live Search and Bing. |
There are also some meta tags which are recognised by many mobile devices:
Meta name tag | Description |
---|---|
viewport | Specifies the intended size when viewing on a mobile device.
Orignally created by Apple for the mobile Safari browser, it has now
been widely adopted as the de-facto standard.
The
|
MobileOptimized | Supported by some Windows mobile browsers. The content specifies the
width of the browser window. For example:
<meta name="MobileOptimized" content="320"> |
HandheldFriendly | Supported by BlackBerry browser.
<meta name="HandHeldFriendly" content="true"> Specifies that the content is optimised for mobile devices. For those devices that support viewport, this is similar in effect to: <meta name="viewport" content="width=device-width, initial-scale=1.0"/> Default is "false". |
HTTP-EQUIV tags
HTTP-EQUIV tags that are not recognised (i.e. supported) by the browser will be silently ignored (i.e. the viewer will not see an error). So you can use HTTP-EQUIV tags safely without worrying too much whether a given browser will support them.
Meta name tag | Description |
---|---|
Content-Type | Specifies the character encoding scheme used for the document. A semicolon
(;) can be used to combine values.
Typical values:
|
Expires | For caching purposes this states when the document expires.
Web robots may delete expired documents from their indexes or may schedule
a revisit. The format is:
content="Weekday, DD MMM YYYY HH:MM:SS TIMEZONE" For example: "Thu, 7 Feb 2002 13:00:00 GMT" An invalid value (such as 0) denotes 'now', forcing a check on each visit. |
Page-Enter | Microsoft Internet Explorer 5.5 and later only.
Specifies how the page should appear to replace the previous page in the browser. For a summary of the transitions available see: http://www.jansfreeware.com/articles/ie-page-transitions.html. The Microsoft documentation on page transitions can be viewed at: http://msdn.microsoft.com/en-us/library/ms532847(VS.85).aspx, but be aware that this concentrates on applying transitions to styles. |
Page-Exit | Microsoft Internet Explorer 5.5 and later only.
Specifies how the page should appear to disappear when the browser moves on to another page. Otherwise the options are the same as for Page-Enter. |
Pragma | There is only one pragma directive:
<meta http-equiv="pragma" content="no-cache"> This requests that the page not be cached locally by the browser. |
Refresh | Tells the browser to wait a specified number of seconds
before loading a new page.
For example to reload the current page after five minutes: content="600" To load a different page after 5 seconds: content="5; url=http://www.cryer.co.uk/index.htm" |
Related Bits
Case
The meta and http-equiv tags are case insensitive, so it does not matter whether these tags are written in upper or lower case, so:
<meta name="robots" content="noindex">
could equally be written as:
<META NAME="ROBOTS" CONTENT="NOINDEX">
The exception is when using XHTML rather than HTML. With XHTML all tags should be in lower case - see below.
XHTML
When using XHTML rather than HTML the meta and http-equiv tags should be self closing and must be lower case.
So whilst in HTML you might use:
<meta name="robots" content="noindex">
or
<META NAME="ROBOTS" CONTENT="NOINDEX">
The equivalent in XHTML would be:
<meta name="robots" content="noindex"/>
note the "/>
" at the end of the tag instead of HTML's ">
".
Other Links
- http://vancouver-webpages.com/META/
- http://www.searchtools.com/robots/robots-meta.html
- http://bookofzeus.com/articles/quick-guide-to-mobile-devices-meta-tags/ - Custom meta tags supported on mobile devices.
If you find any omissions from this list please e-mail the author.