Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Refresh a Page Using Meta Tags

/skill level/
/viewed/
0 Times

Childhood, as far as your basic cheese selections go, was easy. In your typical middle-class family, you had one of three choices:cheddar, Monterey Jack, and those precious, flat, sandwich-sized slices of American. That's what all the cool kids ate. I had to fight my mother to get those into my lunch. She used to make sandwiches with these huge slabs of cheddar cheese that looked like they were hewed from the side of an orange glacier. Although I lost the Wonder Bread battle, I didn't give an inch on this one. For some reason, Mom couldn't see the simple beauty in a perfectly proportioned square of processed cheese food.

The problem with childhood is that we never appreciate it while we have the chance. As I grew up, I developed more mature needs and tastes. Like many young adults lost in the hype of '80s mass cultural wonders like Molly Ringwald and Oingo Boingo, I began to experiment. I told myself that I didn't have a problem, but a little brie here, and a bit of Chaumont there, and before I knew it, I was hooked.

My problems aside, cheese took a serious hit in the early '90s. Cheese, it was discovered, is composed mostly of fat. It's "bad" for you. Less fattening cheeses like feta became all the rage. Feta, if you're unaware, originated in Greece and has been made the same way for thousands of years. Now, aside from the fact that "feta" and "meta" rhyme and share common Greek etymologies, there is absolutely no correlation between the two. You can't eat a <meta> tag, which, frankly, makes it a lot less interesting.

So what is it? Glad you asked. The <meta> tag is often found at the top of an HTML document between the </title> and the </head> tag. It has a variety of uses, but one of the most common is the client-pull function, used to either reload or redirect pages after a specified amount of time. The reload function is relatively simple, and the syntax looks like this:

<meta http-equiv="Refresh" content="30">

Let's break this down. http-equiv gives the name of the http function that you want parsed by the server and content is the amount of time you want to wait before the server goes ahead with the http-equiv. In this case, we're waiting 30 seconds before reloading.

If you want to redirect users to another page, you would add a URL to the tag syntax to tell the server where it should go.

<meta http-equiv="refresh" content="30; URL=http://www.webmonkey.com/">

In this case, when 30 seconds have expired, we're redirected to a new page, which is defined by the URL attribute in the tag.

The <meta> tag can also be used to convey information about your document that can't be found anywhere within it. A lot of people use it to add keywords to their pages. This used to have a huge effect on how the page was indexed by search engines, but since search engines (and keyword writers) have gotten smarter, meta tag keywords have come to carry less sway over search engine indexing.

Putting keywords in your meta tags still helps define what the page is about for some users, though. To do this, you need the name element to -- what else -- give the information a name. This might sound a little silly at first, but if you use the <meta> tag several times in one document to do many different things, it's important to keep the tags straight, otherwise you might have trouble remembering what each one does. The content attribute also differs here. Rather than assigning a refresh time, you use this space to add the keywords:

<meta name="keywords" content="chicken, biscuits, cheese">

In the above example, your document will be referenced by the additional keywords chicken, biscuit and cheese, even if the only thing on your page is a giant JPEG of your favorite NASCAR driver. Of course, this isn't very helpful to your readers, so try to use words that relate to your content.

The uses for the <meta> tag are continuously expanding, so when I figure out more, I'll let you know. Oh, and if you're selecting fine cheeses, I recommend a nice havarti. Although it's from Scandinavia -- which isn't known for its fine cheeses -- havarti's quite delicious.

Contents

Introduction

What you'll need

Steps

Alternate methods

Suggested readings

  • This page was last modified 22:08, 19 May 2008.
Edit this article
Reddit Digg
 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year