What Is a Meta Tag? - Definition & Examples

Instructor: Lonny Meinecke

Lonny teaches psychology classes at King University, and has a bachelor's degree in IT and a doctorate in psychology.

In this lesson we will explain what an HTML meta tag is. Along the way, we will show you a number of examples and also show you how helpful meta tags can be.

What Is a Meta Tag?

If you have been introduced to any HTML at all, you probably know what an HTML tag is. A tag is a special word between angle brackets, which makes a very readable way to organize things in a web page document. Here's an example of an HTML tag:

A typical HTML tag
typical html tag

So that's a tag. They usually come in opening and closing pairs like the ones shown in the above example (e.g., <insert tag > , </insert tag>). A meta tag is a lot like a regular HTML tag, except the word 'meta' means 'about' (and it doesn't need a closing tag unless you're using XHTML). The thing is, most HTML tags define or contain actual data you can see on the site, whereas a meta tag defines something 'about' data (what we call metadata) which you typically can't see.

Imagine it's Christmas, and you want to keep track of all the presents you bought for everybody, but you don't want to write it on the packages. You could maintain an inventory tag for each package. Well, that's kind of what a meta tag is like, too. It's a bit of information about your web page meant for organizing, or some other need, without being visible to receivers. Like so:

A metaphor for meta tags
gift inventory tag

Metadata is like text hidden in web pages so users can't see it, though it's still there. Why? Web pages use meta tags so that search engines, robots, web crawlers, and other automatic things can scan web pages and gather critical information needed to find or organize them. Here is a common example of a very useful meta tag, which has been inserted within the open and closed markers of the <head> section:

The keywords meta tag
keywords meta tag

(Notice that meta tags do not come in open and closed pairs. The meta information is simply contained within one open angle bracket at the beginning and one closed angle bracket at the end. Refer to the green arrow in the image above.)

As you can see, a meta tag always uses a name/value pair, with the left side of the equal sign listing the name or label, and the right side listing its associated value (e.g., name='keywords'). In the above example, the meta tag 'name' is paired with the term keywords and the meta tag 'content' is paired with the words metadata, html lesson. It's just an easy way to associate a label with something.

This particular meta tag lists the keywords associated with our web page. Now, when search engines scan the page, they will find the keywords 'metadata' and 'html lesson'--even if most people visiting the page can't see those words. So, if somebody searches for 'html lesson,' there's a good chance they will see our page listed in their search results. Nifty, huh?

Kinds of Meta Tags

Would you like to see some other examples of meta tags? We looked at one for keywords; there are also meta tags for the author of the web page, the site description, and the last revised page version (among others). All of our meta tags go in the header (or <head>) section, not the body (or <body>) section. Here's an example of the three we just mentioned:

Some meta tag examples
meta tag examples

As you can see, within the <head> section, the meta name of 'author' is paired with the content (or author's name in this case) 'Sammy Sue.' The meta information for the site description and revision details comes right after that, followed by the closing </head> tag.

We can also do some tricky things with meta tags. We can tell our web page to redirect the user somewhere else, which can be very handy:

The redirect meta tag
redirect meta tag

As you can see, in the <head> section, we used the meta tag 'refresh' and set it to three seconds. After three seconds, the user's browser will redirect them to the URL we specified.

We can even use a meta tag to set cookies (keep track of what users do while they visit our web page, and save it on their computer). That way, when those same users visit our page again, they can pick up right where they left off:

The cookies meta tag
cookies meta tag

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create An Account
Support