Web Publishing Reference Guide
Using Meta Tags
On this page:
Keywords and Description
Document Author
Document Language
Robot Indexing Instructions
Setting an Expiration Date
Automatic Redirect to Another Document
Meta tags are used to specify information about your document. Although there are many kinds of metadata, meta tags are most commonly used to help search engines find your site, and to create redirects.
Meta tags belong within the <HEAD> section of a document, and are not visible on the page. They do not take a closing </META> tag. You can use many meta tags within a single document. (View the source of this document to see how we've used them ourselves.)
We will only discuss a few of these meta tags here. For more information, please see the World Wide Web Consortium's notes on helping search engines index your site as well as information about the Dublin Core set of meta tags.
Keywords and Description
You can specify keywords related to your document that may help search engines rank you within their listings. You can also specify a brief description of your document.
These tags take the following format:
<meta name="keywords" content="meta tags, HTML, WCS, FAQ" />
<meta name="description" content="WCS FAQ about using meta tags at MIT" />
Keep your descriptions accurate but short. Because some HTML authors have abused meta tags (e.g., by using hundreds of keywords, only some of which relate directly to their site), a few search engines ignore meta tags when weighting their rankings (most notably, Excite). Please don't contribute to this problem!
Document Author
You can specify a name and email address for the person responsible for the content of the document. Regardless of whether search engines now pick up this information, it's a good idea to include it.
<meta name="Author" content="Deborah Levinson" />
<link rev="made" href="mailto:web-request@mit.edu" />
Document Language
If you have versions of your HTML document available in other languages, you can specify this in a meta tag. This will help search engines provide the right version of the document to people searching in non-English languages.
<link rel="alternate" type="text/html" href="mver-french.html" hreflang="fr" lang="fr" title="Ma Vie en Rose" />
Robot Indexing Instructions
Sometimes you may have data on your pages you do not want indexed by a search engine. One way to prevent robot "spiders" from following all the links on your page is to use the following tag:
<meta name="robots" content="noindex, nofollow" />
Setting an Expiration Date
In cases where your data changes on a regular basis (or even an irregular basis), you should consider using a meta tag to tell the browser when to look for a new copy of your document. The date, expressed as a two-digit day, three-letter month, and four-digit year, represents the day on which the browser should reload a fresh copy.
<meta http-equiv="expires" content="01 Jul 1999" />
Automatic Redirect to Another Document (Meta Refresh Tag)
When you rename a page or move a page or site from one directory location to another, this results in a change in URL for that page or site. Whenever you change a page's URL, you can put a redirect page in place at the old URL. Users may have bookmarked the old URL or other web pages may link to it.
Without a redirect page, users following links to the old URL will get a 404 (Page not found) error. A redirect page will automatically route the user to the new location, as invisibly as you desire. In the META-HTTP-EQUIV tag, the content attribute indicates how many seconds (in the example below, 5 seconds) before the user is whisked off to the new location specified in the URL attribute. We recommend using 3-5 seconds on all redirects so the users are made aware that the page has moved and have time to read the short message displayed. Zero second redirects are not recommended if you want your users to update their bookmarks.
You may copy this code to create a new page at the old location, editing appropriately:
<!doctype html public"-//w3c//dtd html 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Refresh" content="5;
url=http://www.newlocation.com/page.html" />
<title>Please note the change of address!</title>
</head>
<body bgcolor="#ffffff">
<h2>We have moved! Please update your bookmarks! If you are
not automatically redirected to the new address in 5 seconds,
please go to <a href="http://www.newlocation.com/page.html">
http://www.newlocation.com/page.html</a></h2>
</body>
</html>
Once you've created this page, you will need to change the permissions in your top-level directory to make it world-readable.
IS&T Service Desk
Monday-Friday
Telephone/Online: 8am - 6pm
Walk-In (N42) 9:15am - 5pm
Web: IS&T Service Desk
Email: computing-help@mit.edu
Phone: 617.253.1101

