|
i/s Back
Issues
Volume
14
No.
1 September/October
1998
Don't Overlook Meta Tags: This HTML Element Has Many
Uses
Robyn Fizz and Deborah Levinson
If you're like most people who publish on the Web, you've
probably heard about meta tags but aren't sure what they do.
While these tags aren't required elements in Web page code,
they can perform several useful tasks. This article gives a
brief overview of their functionality and how to use them.
The prefix "meta" means, among other things,
comprehensive or transcending. In HTML, meta tags let you
specify information about your document as a whole. In
practical terms, you can
Specify keywords and a description for your document that
can help search engines rank the page within their listings
Instruct Web robots not to index a page
Supply a name and email address for the document's author
Set an expiration date for a page
Automatically redirect users to another document
A Few HTML Basics
Meta tags belong in the <head> section of an HTML
document, before the <body> tag. They do not take a
closing </meta> tag.
You can use several meta tags with different attributes
within the same document. For the correct HTML code, see the
examples in the screened box to the right. Make sure that
your meta tags don't include line breaks, since these can
cause some search engines to balk.
Keywords and Description
By indicating content, the keywords and description
attributes aid search engine robots in ranking your pages.
When you enter keywords for a page, each word or phrase
should be separated by a comma. Remember to include synonyms
and, when you use acronyms, to spell them out as well. In
general, use a large number of keywords only on your site's
index page. There's no need to add keywords to every page in
your site - a few representative samples will do the job.
The description attribute returns your description of the
page in place of the summary the search engine would
ordinarily create (from the first several words it
encounters on a page). Keep your descriptions accurate but
short, under 20 words.
Be aware that a few search engines (most notably, Excite)
ignore keyword and description attributes when weighting
their rankings.
Robot Indexing Instructions
Sometimes, rather than trying to make your page more visible
to search engines, you don't want a page to be indexed at
all. In this instance, use the robots attribute with a value
of "noindex, nofollow." "Noindex" tells the robot not to
index the page, and "nofollow" tells it not to follow links
from this page to other pages.
Author Information
You can specify a name and email address for the document's
creator or maintainer. While many search engines don't pick
up this information, it's still a good idea to include it.
Setting an Expiration Date
If your data changes on a regular basis, use the expire
attribute to tell browsers when to look for a new copy of
your document. In short, this attribute sets limits on how
long your browser caches a file.
The date should be expressed as a two-digit day,
three-letter month, and four-digit year. (While not standard
practice, setting the expires attribute to "0" forces a
reload each time.)
Web robots may delete expired documents from a search
engine or schedule a revisit.
Automatic Redirects
A meta tag that uses the refresh attribute lets you
automatically redirect users to a different page. This is
helpful in cases where a URL has changed and you need a
quick way to let people know about it.
Since some older browsers don't recognize this tag, it's
important that you also place an actual HTML link to your
new file on the redirection page.
In the code for automatic redirects (see the box below),
the number before the semicolon represents the time, in
seconds, before the browser loads the specified URL. Using
"0" will cause a nearly instantaneous redirect to the other
page.
More about Meta Tags
The document "Using Meta Tags at MIT" served as a source for
this article and provides more in-depth detail, including a
template for a simple re-direction page. It's online at
http://web.mit.edu/ist/web/reference/create/metatags.html. You can
view the source for this document to see assorted meta tags in
use.
You can also learn more about meta tags by visiting
webdeveloper.com. This site offers a Meta Tag Tutorial at
http://www.webdeveloper.com/categories/html/html_metatags.html
and a Meta Tag Resource Page at
http://webdeveloper.com/categories/html/html_metatag_res.html
In HTML: A Meta Tag Sampler
Keywords and Description
<meta name="keywords" content="meta tags, HTML,
attributes">
<meta name="description" content="article on using meta
tags">
Robots
<meta name="robots" content="noindex,nofollow">
Author
<meta name="author" content="Deborah Levinson">
<link rev="made" href="mailto:cwis-help@mit.edu">
Expires
<meta http-equiv="expires" content="01 Jul 1999">
Refresh (Automatic Redirect)
<meta http-equiv="refresh"
content="0;URL=web.mit.edu/ist/isnews">
i/s
Home |
i/s
Back Issues |
Volume
14 |
No.
1
|