Click here to Skip to main content
15,899,679 members
Articles / Web Development / HTML
Article

Beginner's guide to Meta Tags

Rate me:
Please Sign up or sign in to vote.
4.03/5 (14 votes)
26 Jun 20023 min read 123.8K   54   19
This is a guide to using HTTP-EQUIV and NAME meta tags.

What are meta tags?

Meta tags are tags that reside in between the <head> and </head> tags of your html. There are two different types of meta tags. One uses the NAME attribute, and the other uses the HTTP-EQUIV.

  • NAME: The name tags that do not correspond to HTTP headers.
  • HTTP-EQUIV: These are tags that do correspond to http headers.

Why use meta tags?

The http-equiv tags do not need to be used. In fact, neither do the name tags, except, without name tags, your website cannot be indexed by many search engines. Most search engines use a bot to crawl through the pages of your website, these bots look for certain name tags, that give information such as keywords and a description of the page. That data is then stored in the search engines database. An example of a typical meta name meta tag is:-

<meta name="keywords" content="key,word,about,my,site">
<meta name="description" content="my page is about bla">

At minimum you should put these tags in your pages.

The NAME tags

I have  listed a load of name tags that can be used, but only the ones marked with an * actually need to be used.

Description*

This is a short description of what is on the page. Important when the pages is a frameset.

<meta name="description" content="This site is full of 
code for programmers.">

Keywords*

These are important words that have something to do with the page. Words like the and other insignificant words would be ignored by the spider.

<meta name="keywords" content="c++, code, programming">

Author

This is the name of the author of the page.

<meta name="author" content="chris maunder">

Generator

Usually the name and version number of the tool used to make the page. With most programs, this is added to pages automatically. Possibly used by the application vendors, to discover market penetration.

Copyright

This is who the copyright for the page belongs to.

<meta name="copyright" content="chris maunder">

Robots

Controls how a spider indexes that page.

  • NOINDEX - tells the spider not to index anything on the page.
  • NOFOLLOW - tells the spider not to follow links on the page, and index those as well.
  • NOIMAGEINDEX - tells the spider not to index images on the page.
  • NOIMAGECLICK - tells the spider not to link directly to the image, but to the page it is on instead.
  • [Google Only (I think)] NOARCHIVE - tells the spider not to cache the page.

<meta name="robots" content="NOINDEX">

The HTTP-EQUIV tags

Expires

This is used when the content on the page would expire. If a spider detects this, it would either delete the page from the search engine database, or re-index the page on the expiry date.

<META HTTP-EQUIV="expires" CONTENT="Thu, 27 Jun 2002 10:56:57 GMT">

Cache-Control

Tells the browser how to handle its caching of that page.

  • PUBLIC - may be cached in publicly shared caches.
  • PRIVATE - cached only in a private cache.
  • NO-CACHE - do not cache the page.
  • NO-STORE - may be cached but not archived.

<META HTTP-EQUIV="cache-control" CONTENT="no-cache">

Content-Type

This causes the browser to load the correct character set before loading the page.

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; 
charset=iso-8859-1">

Content-Style-Type

This is how styles are defined in the page.

<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

Content-Language

This of course, is the language the page is in.

<META HTTP-EQUIV="Content-Language" CONTENT="EN-GB">

Refresh

This tag causes the page to refresh and load the specified page after a specified amount of time. The delay is in seconds.

<META HTTP-EQUIV="Refresh" CONTENT="10; http://www.codeproject.com">

Set-Cookie

This allows the page to set a cookie to expire on a certain date.

<META HTTP-EQUIV="Set-Cookie" CONTENT="cookievalue=cp; 
expires=Thu, 27 Jun 2002 10:56:57 GMT; path=/">

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United Kingdom United Kingdom
Nnamdi was born in 1986, all his life he has been into anything electrical (starting with plug sockets as soon as he could crawl) from there it moved onto dismantelling things to see what they looked like on the inside. Eventually this interest moved on to computers.

Started simple, with HTML, and moved on to JS. Then moved onto C#, he's all over the shop, doing programming(ish) type things, web designing [My Website] and graphics, although he cant draw to save his life.

He likes to use his computer, socialise with his mates, and laugh at his mates as they all try to apply for holiday jobs, while he has an office job in London, as a network administrator, all because he wowed his boss when he went there on work experience.

He goes by the alias 'TheEclypse'

Comments and Discussions

 
GeneralMy vote of 3 Pin
Narendra Singh Rathore1-Mar-13 1:15
professionalNarendra Singh Rathore1-Mar-13 1:15 
QuestionGood but time for an update? Pin
Ed Nutting17-Aug-12 17:40
Ed Nutting17-Aug-12 17:40 
QuestionStandart asp.net meta control Pin
Nickos_me17-Nov-11 20:32
Nickos_me17-Nov-11 20:32 
GeneralMy vote of 4 Pin
Member 43208449-Nov-11 21:21
Member 43208449-Nov-11 21:21 
Nice article thanks.
Questionnon-HTML content Pin
Lyubomir3-Aug-07 4:53
Lyubomir3-Aug-07 4:53 
GeneralEasy way to setup metainformation in Asp.Net Pin
Mike Chaliy27-Mar-06 10:14
Mike Chaliy27-Mar-06 10:14 
GeneralRe: Easy way to setup metainformation in Asp.Net Pin
Nickos_me17-Nov-11 0:49
Nickos_me17-Nov-11 0:49 
GeneralThanks Pin
S Douglas11-Jan-05 22:38
professionalS Douglas11-Jan-05 22:38 
GeneralRe: Thanks Pin
Trance Junkie31-May-05 22:46
Trance Junkie31-May-05 22:46 
GeneralRe: Thanks Pin
Ricardo Casquete21-Feb-06 5:15
Ricardo Casquete21-Feb-06 5:15 
GeneralCan't get expires to work... Pin
Tom Archer17-Nov-02 2:54
Tom Archer17-Nov-02 2:54 
GeneralRe: Can't get expires to work... Pin
Nnamdi Onyeyiri17-Nov-02 3:36
Nnamdi Onyeyiri17-Nov-02 3:36 
GeneralRe: Can't get expires to work... Pin
Tom Archer17-Nov-02 3:45
Tom Archer17-Nov-02 3:45 
GeneralRe: Can't get expires to work... Pin
Nnamdi Onyeyiri17-Nov-02 4:02
Nnamdi Onyeyiri17-Nov-02 4:02 
GeneralRe: Can't get expires to work... Pin
icstrategy18-Jun-03 6:01
sussicstrategy18-Jun-03 6:01 
GeneralRe: Can't get expires to work... Pin
Online muggings28-Oct-04 23:54
sussOnline muggings28-Oct-04 23:54 
GeneralRe: Can't get expires to work... Pin
Member 6817033-Nov-03 21:03
Member 6817033-Nov-03 21:03 
GeneralRe: Can't get expires to work... Pin
The Haus20-Jan-04 9:09
sussThe Haus20-Jan-04 9:09 
GeneralRe: Can't get expires to work... Pin
JVMFX23-Mar-06 7:39
JVMFX23-Mar-06 7:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.