Vol. 1, No. 44
Getting Meta All The Time
We've already covered some aspects of the META tag; in our "promoting
your site" issue, for example. But it'd be nice to take a step back and
look at the big picture, as it were. You ask, what are META tags, and
what can they do for me?
First, a moment of theory. The stuff you see on a Web page: the text,
the pictures, the way it's arranged -- that's data. On the other hand,
information ABOUT the page, such as who created it -- that's called
metadata: data about data. Visitors to the page don't see it, but it can
be encoded in META tags so it's there for people who care. Slightly
confusingly, the META tag can also be used to send certain types of HTTP
header information to the browser, to control aspects of how the browser
behaves. More on that in a little bit.
META tags are found in the HEAD section of your page. Each one has two
attributes: name and content. The name identifies what kind of META tag
it is, and the content is where the actual information in the tag goes.
So the basic tag looks like this:
<META name="some name" content="some content">
Here are the basic informational META tag types. The author tag is used
to provide the name of the author, like so:
<META name="author" content="Luther Blissett">
The description tag is generally a sentence or three telling basically
what the site is. The content of this tag is often harvested by search
engines to describe the pages they index. It goes a little like this:
<META name="description" content="This is a page discussing Tasmanian
devils. It includes pictures of cute devils as well as step-by-step
instructions on what to do if one gets a hold of you.">
The keywords META tag is probably the most commonly used one. You
probably already know all about it. It's just a list of words that you
think people who want to find your page will type into search engines.
See the "promoting your site" issue of this newsletter for details on
how to use this tag.
And the robots tag contains instructions to web-indexing robots, as to
whether you want them to index your page, follow your links, or not. So,
for example:
<META name="robots" content="NOINDEX,FOLLOW">
will tell the obedient bots that they shouldn't index this page, but
they should follow the links that're on it and see what else is around.
(By default, robots both index and follow everything, unless you tell
them not to.)
That's a rundown of the metadata options that the META tag has to offer.
Now let's look at how to control your users' browsers with META tags.
These have a slightly different look to them:
<META http-equiv="some equiv thingy" content="some content">
Note the "http-equiv" part.
Probably the most fun you can have with a META tag involves the refresh
tag. This will automatically send users to another URL, after a
specified amount of time has elapsed. The syntax for the content part is
the number of seconds to delay, then a semicolon, then the new
destination URL:
<META http-equiv="Refresh" content="15; URL=http://www.tripod.com/">
As if by magic, the user is whisked away to www.tripod.com after 15
seconds.
Refresh is a hard act to follow, but the META tag has a few more little
tricks up its sleeve. The expires tag allows you to force the browser to
not cache a page, so that it loads a new copy from the server each time
the page is viewed. This is primarily useful for pages with dynamic
content. Just set the expiry date to 0, and caching will be disabled:
<META http-equiv="Expires" content="0">
To make a page expire at a specific time in the future, spell it out in
Greenwich Mean Time like this:
<META http-equiv="Expires" content="Thu Dec 14 16:45:31 GMT 2000">
META http-equiv tags can also be used to specify how the browser should
treat the content. If you want the page to be displayed in a specific
character set, like say ISO-8859-9, the Turkish character set, you can
specify that with a Content-Type tag, which would look like this:
<META http-equiv="Content-Type" content="text/html;
charset="ISO-8859-9">
Content-Type can also be used to specify whether a page should be
considered HTML, plain text, an image, or whatever.
And that's about the size of it. There are many more META tags that can
be used for special occasions, but they're fairly rare. And you've got
enough to work with for now. So get tagging!
HINTS, POINTERS, AND TIPS 'O THE TRADE:
There are some browsers out there that don't support META refresh
instructions. For these people, it's polite to provide a traditional
clickable link in addition to your META-matic redirection.
You can create an easy template for all the Web pages you build that
includes the same META header info each time: your name, what the site's
about, the keywords.
Pay attention to what you're doing, no matter how excited you get. If
you type META fast and carelessly, you're likely to end up with a MEAT
tag, which is a totally different thing.
RESOURCES:
Promoting your site
Sending Search Engine Traffic To Your Site
Intro to RDF metadata