Meta element

Meta elements are HTML or XHTML elements used to provide structured metadata about a Web page. Such elements must be placed as tags in the  section of an HTML or XHTML document. Meta elements can be used to specify page description, keywords and any other metadata not provided through the other  elements and attributes.

The meta element has four valid attributes:,  ,  , and. Of these, only  is a required attribute.

An example of the use of the element
In one form,  elements can specify HTTP headers which should be sent before the actual content when the HTML page is served from Web server to client. For example: This specifies that the page should be served with an HTTP header called 'Content-Type' that has a value 'text/html'. This is a typical use of the  element, which specifies the document type so a client (browser or otherwise) knows what content type to render.

In the general form, a  element specifies   and associated   attributes describing aspects of the HTML page. For example: In this example, the  element identifies itself as containing the 'keywords' relevant to the document, Wikipedia and encyclopedia.

Meta tags can be used to indicate the location a business serves: In this example, geographical information is given according to zip codes.

Meta element used in search engine optimization
Meta elements provide information about a given Web page, most often to help search engines categorize them correctly. They are inserted into the HTML document, but are often not directly visible to a user visiting the site.

They have been the focus of a field of marketing research known as search engine optimization (SEO), where different methods are explored to provide a user's site with a higher ranking on search engines. In the mid to late 1990s, search engines were reliant on meta data to correctly classify a Web page and webmasters quickly learned the commercial significance of having the right meta element, as it frequently led to a high ranking in the search engines — and thus, high traffic to the website.

As search engine traffic achieved greater significance in online marketing plans, consultants were brought in who were well versed in how search engines perceive a website. These consultants used a variety of techniques (legitimate and otherwise) to improve ranking for their clients.

Meta elements have significantly less effect on search engine results pages today than they did in the 1990s and their utility has decreased dramatically as search engine robots have become more sophisticated. This is due in part to the nearly infinite re-occurrence (keyword stuffing) of meta elements and/or to attempts by unscrupulous website placement consultants to manipulate (spamdexing) or otherwise circumvent search engine ranking algorithms.

While search engine optimization can improve search engine ranking, consumers of such services should be careful to employ only reputable providers. Given the extraordinary competition and technological craftsmanship required for top search engine placement, the implication of the term "search engine optimization" has deteriorated over the last decade. Where it once implied bringing a website to the top of a search engine's results page, for some consumers it now implies a relationship with keyword spamming or optimizing a site's internal search engine for improved performance.

Major search engine robots are more likely to quantify such extant factors as the volume of incoming links from related websites, quantity and quality of content, technical precision of source code, spelling, functional v. broken hyperlinks, volume and consistency of searches and/or viewer traffic, time within website, page views, revisits, click-throughs, technical user-features, uniqueness, redundancy, relevance, advertising revenue yield, freshness, geography, language and other intrinsic characteristics.

The attribute
The  attribute was popularized by search engines such as Infoseek and AltaVista in 1995, and its popularity quickly grew until it became one of the most commonly used   elements. By late 1997, however, search engine providers realized that information stored in  elements, especially the   attribute, was often unreliable and misleading, and at worst, used to draw users into spam sites. (Unscrupulous webmasters could easily place false  into their   elements in order to draw people to their site.)

Search engines began dropping support for metadata provided by the  element in 1998, and by the early 2000s, most search engines had veered completely away from reliance on   elements. In July 2002, AltaVista, one of the last major search engines to still offer support, finally stopped considering them.

No consensus exists whether or not the  attribute has any effect on ranking at any of the major search engines today. It is speculated that it does, if the keywords used in the  can also be found in the page copy itself. With respect to Google, thirty-seven leaders in search engine optimization concluded in April 2007 that the relevance of having your keywords in the -attribute   is little to none and in September 2009 Matt Cutts of Google announced that they are no longer taking keywords into account whatsoever. However, both these articles suggest that Yahoo! still makes use of the keywords meta tag in some of its rankings. Yahoo! itself claims support for the keywords meta tag in conjunction with other factors for improving search rankings.

The attribute
Unlike the  attribute, the   attribute is supported by most major search engines, like Yahoo and Bing, while Google will fall back on this tag when information about the page itself is requested (e.g. using the related: query). The  attribute provides a concise explanation of a Web page's content. This allows the Web page authors to give a more meaningful description for listings than might be displayed if the search engine was unable to automatically create its own description based on the page content. The description is often, but not always, displayed on search engine results pages, so it can affect click-through rates. Industry commentators have suggested that major search engines also consider keywords located in the  attribute when ranking pages. W3C doesn't specify the size of this description meta tag, but almost all search engines recommend it to be shorter than 155 characters of plain text.

The attribute
The  attribute tells search engines what natural language the website is written in (e.g. English, Urdu or French), as opposed to the coding language (e.g. HTML). It is normally an IETF language tag for the language name. It is of most use when a website is written in multiple languages and can be included on each page to tell search engines in which language a particular page is written.

The attribute
The  attribute, supported by several major search engines,  controls whether search engine spiders are allowed to index a page, or not, and whether they should follow links from a page, or not. The attribute can contain one or more comma-separate values. The  value prevents a page from being indexed, and   prevents links from being crawled. Other values recognized by one or more search engines can influence how the engine indexes pages, and how those pages appear on the search results. These include, which instructs a search engine not to store an archived copy of the page, and  , which asks that the search engine not include a snippet from the page along with the page's listing in search results.

Meta tags are not the best option to prevent search engines from indexing content of a website, because a more reliable and efficient method is the use of the Robots.txt file (robots exclusion standard).

NOODP
The search engines Google, Yahoo! and MSN use in some cases the title and abstract of the Open Directory Project (ODP) listing of a Web site for the title and/or description (also called snippet or abstract) in the search engine results pages (SERPS). To give webmasters the option to specify that the ODP content should not be used for listings of their website, Microsoft introduced in May 2006 the new " " value for the " " element of the meta tags. Google followed in July 2006 and Yahoo! in October 2006.

The syntax is the same for all search engines who support the tag.

Webmasters can decide if they want to disallow the use of their ODP listing on a per search engine basis

NOYDIR
Yahoo! puts content from their own Yahoo! directory next to the ODP listing. In 2007 they introduced a meta tag that lets web designers opt-out of this.

If you add the  tag to a page, Yahoo! won't display the Yahoo! Directory titles and abstracts.

Yahoo! also introduced in May 2007 the attribute value:. This is not a meta tag, but an attribute and value, which can be used throughout Web page tags where needed. Content of the page where this attribute is being used will be ignored by the Yahoo! crawler and not included in the search engine's index.

Examples for the use of the  tag:

Academic studies
Google does not use HTML keyword or meta tag elements for indexing. The Director of Research at Google, Monika Henziger, was quoted (in 2002) as saying, "Currently we don't trust metadata because we are afraid of being manipulated." Other search engines developed techniques to penalize Web sites considered to be "cheating the system". For example, a Web site repeating the same meta keyword several times may have its ranking decreased by a search engine trying to eliminate this practice, though that is unlikely. It is more likely that a search engine will ignore the meta keyword element completely, and most do regardless of how many words used in the element.

Google does, however, use meta tag elements for displaying site links. The title tags are used to create the link in search results:

The meta description often appears in Google search results to describe the link:

Redirects
Meta refresh elements can be used to instruct a Web browser to automatically refresh a Web page after a given time interval. It is also possible to specify an alternative URL and use this technique in order to redirect the user to a different location. Using a meta refresh in this way and solely by itself rarely achieves the desired result. For Internet Explorer's security settings, under the miscellaneous category, meta refresh can be turned off by the user, thereby disabling its redirect ability entirely.

Many Web design tutorials also point out that client side redirecting tends to interfere with the normal functioning of a Web browser's "back" button. After being redirected, clicking the back button will cause the user to go back to the redirect page, which redirects them again. Some modern browsers seem to overcome this problem however, including Safari, Mozilla Firefox and Opera.

Auto-redirects via markup (versus server side redirects) are not in compliance with the W3C's - Web Content Accessibility Guidelines (WCAG) 1.0 (guideline 7.5).

HTTP message headers
Meta elements of the form  can be used as alternatives to http headers. For example,  would tell the browser that the page "expires" on June 21 2006 at 14:25:27 GMT and that it may safely cache the page until then.

Alternative to elements
An alternative to  elements for enhanced subject access within a website is the use of a back-of-book-style index for the website. See examples at the websites of the Australian Society of Indexers and the American Society of Indexers.

In 1994, ALIWEB, also used an index file to provide the type of information commonly found in meta keywords attributes.