HTML: <META>

 

<META>

Providing a Description

The <META> tag goes in the <HEAD> section. Two of the most popular attributes of the <META> tag are NAME and CONTENT. One use of <META> is to provide a description of the web page for use by search engines; to achieve this NAME is set to "DESCRIPTION" and CONTENT provides a description of the page. Here is sample code for a brief page that is devoted to explaining <META>:

<HEAD>

<META NAME="DESCRIPTION" CONTENT="A brief HTML file that demonstrates how to provide a description of a page using the META tag. A search engine will look at this description when cataloguing the site.">

</HEAD>

 

 

Providing Keywords

 

The <META> tag is also used to provide a series of keywords that are related to the content of the web page. The search engines record these keywords and then use them to display pages that match a viewer's query. If you post a web page with information on the writer Willa Cather, for example, you would want to include "Willa Cather" as a keyword in <META>.

 

The <META> attributes NAME and CONTENT are again used to post keywords. Following is sample code for the page, mentioned above, that explains the <META> tag. The <META> tag can occur many times in one page, and the description given above is included in the code. The keywords may be case-sensitive, so both lowercase and uppercase versions of the keywords are included here:

 

<HEAD>

<META NAME="DESCRIPTION" CONTENT="A brief HTML file that demonstrates how to provide a description of a page using the META tag. A search engine will look at this description when cataloguing the site.">

<META NAME="KEYWORDS" CONTENT="meta; metadata; meta data; meta description; META; METADATA; META DATA; META DESCRIPTION">

</HEAD>

 

This web page is not very exciting because everything of interest takes place invisibly in the HEAD section, but nevertheless:

to see this how this code looks in a window. (And View the Page Source.)

 

 

 

Refresh

Another popular use of <META> is to send the viewer to another destination after a brief pause. This is called a "splash screen." For this use, the HTTP-EQUIV attribute replaces the NAME attribute. The length of the pause is given in the CONTENT attribute, along with the destination to which the viewer is directed. Here is sample code that sends the viewer to the Metuchen High School page, after a 6-second pause:

 

<META HTTP-EQUIV=Refresh CONTENT="6; URL=http://metuchenhigh.org">

 

to see this how this code works in a window.

 

 

 

Robots

The electronic devices that crawl around the World Wide Web, cataloguing web sites in the service of search engines, are called robots. The <META> tag theoretically has the potential to affect whether a robot indexes a given page, and whether a robot indexes the links on the page. In other words, the <META> tag is supposed to be able to say to a robot, "Don't index this page" or "Don't index the links on this page." (The link to HTML Help below has information on how this is supposed to work using <META>.) In practice, few robots are programmed to listen to what they are asked to do in a page's <META> tag. There are other ways to affect the indexing of a web page. Here is one link with more information on robots and indexing:

www.robotstxt.org/meta.html

 

Other Resources

Try these links on <META>:

Page Link
<META> Tag www.htmlhelp.com/reference/html40/head/meta.html

or check out one of our reference books, or look for other help on the Web.

 

Exercise

Work on either 1) your own web page, or 2) the eEverything.com web site. Add a <META> tag to provide a useful description for your page. Add a second <META> tag to provide several keywords for the page.

Thirdly, use the <META> tag to provide a "splash screen" that briefly shows a page before directing the viewer to another page. (You do not have to keep this splash screen active after you get it to work and show it to me.)

If you work on eEverything.com, the description should mention that eEverything.com is a great place to visit to find...just about everything. The keywords should include shop, shopping, e-commerce, furniture, appliances, clothes, books, music, tickets, weather information, auctions, travel and electronics.