Click here to Skip to main content
Email Password   helpLost your password?

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.

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.

<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.

<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=/">

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
Questionnon-HTML content
Lyubomir
5:53 3 Aug '07  
Does anybody know how to disable search engine caching for non-HTML content?
E.g. I would like to sell PDFs throgh web. I need to give complete PDFs to search bots only for indexing. But they should not show link "view change" or "view as html" on theirs.

p.s.
I'm using iTextSharp for PDF generation.

GeneralEasy way to setup metainformation in Asp.Net
Mike Chaliy
11:14 27 Mar '06  
Hello.

I was develop Web Server Meta Control[^]. Something like easy way to start with keywords and other meta tags. Hope this will help.

Thanks.
GeneralThanks
sfdougl
23:38 11 Jan '05  
Thanks for the quick reference material...




Social Engineering Specialist.

Because there is no patch for human stupidity.
GeneralRe: Thanks
Trance Junkie
23:46 31 May '05  
Helped me 2 !Laugh Laugh Laugh
GeneralRe: Thanks
Ricardo Casquete
6:15 21 Feb '06  
Very Good material

Ricardo Casquete
GeneralCan't get expires to work...
Tom Archer
3:54 17 Nov '02  
Using your article as a guideline, I've tried the following simply test and it still doesn't work in that the user is able to navigate back to the first without error.


TOM1.HTML

<html>
<head>
<title>tom1</title>
<META HTTP-EQUIV="expires" CONTENT="Thu, 27 Jun 2002 10:56:57 GMT">
</head>
<body>
<a href="tom2.html">tom2 </body>

TOM2.HTML

<html>
<head>
<title>tom2</title>
</head>
<body>
You're on tom2
</body>


I've also tried to use the following it doesn't work either:
<META HTTP-EQUIV="expires" CONTENT="Thu, 27 Jun 2002 10:56:57 GMT">

Cheers,
Tom Archer Author - Inside C#, Visual C++.NET Bible
GeneralRe: Can't get expires to work...
Nnamdi Onyeyiri
4:36 17 Nov '02  
This tag is for search engines, or any bots that may index the site, putting that there, will let the bot know that the information on the page is no longer valid, so it will ignore the page, or in the case of a search engine, remove it from the database.

sorry if i didnt make myself clear before. Smile

1001111111011101111100111100101011110011110100101110010011010010
Sonork | 100.21142 | TheEclypse


GeneralRe: Can't get expires to work...
Tom Archer
4:45 17 Nov '02  
I was hoping it was for the browser. Thanks Nnamdi.

Cheers,
Tom Archer Author - Inside C#, Visual C++.NET Bible
GeneralRe: Can't get expires to work...
Nnamdi Onyeyiri
5:02 17 Nov '02  
well if you dont want them to go to a page after a certain date, you can always use javascript, i think this should do it.
<script language="JavaScript">
function CheckDate()
{
// Get todays date.
var now = new Date();

// Create a date object for the valid until.
var valid_until = new Date("November 7, 2002");

// check if it is valid, else go to CodeProject.
if (now > valid_until)
window.location = 'http://www.codeproject.com';
}

CheckDate();
</script>
NOTE: using the valid_until in the form above, will make it take as being from midnight on November 6, 2002 the page is invalid, if you want to be more preciece, you can add the time, by creating valid_until using new Date("November 7, 2002 12:00:00"); [24hr clock]

This is not full proof, as it uses the date on the users machine, to compare to the expire date.

1001111111011101111100111100101011110011110100101110010011010010
Sonork | 100.21142 | TheEclypse


GeneralRe: Can't get expires to work...
icstrategy
7:01 18 Jun '03  
Have you looked at what expedia.com uses to "expire" the pages when you are navigating back?

I'm trying to replace code on a web site that someone else coded with a "self_Expire" value if the pages sees that value it will do a "History.forward()" call and forces the browser back to the page where the user was when they pressed the back button.

This is NOT user-friendly... so I'm trying to replace it.

Any ideas?

Thanks!


GeneralRe: Can't get expires to work...
Online muggings
0:54 29 Oct '04  
icstrategy wrote: I'm trying to replace code on a web site that someone else coded with a "self_Expire" value if the pages sees that value it will do a "History.forward()" call and forces the browser back to the page where the user was when they pressed the back button.
This is a commonly used facility and is quite frankly viscous.

"consider this point"

You go to a website with the intention to buy something, or even just view. You find the meta tags used have given you a duff link so you try to go back to your search engine only to find that the webmaster has expired the history and forced you back to thier site.

"What impression does this user then have ??"

Answer: I have been acosted by a pushy salesman and lead to an alley with only one exit. The salesman then proceeds to stand in the only exit while trying to push his ware onto me.

Result: The user thinks, Im going to get mugged here - these people are criminals!

Poser: Is this how you want your visitors to see you.

Disabling the back button is one of the WORST things you can do to visitors. If they want to leave, let them, don't mug them. Instead use better meta tags and do not put irrelevant information in your content tags.
GeneralRe: Can't get expires to work...
Hans-Olof Hansson
22:03 3 Nov '03  

OK, but...

I would like to FORCE the browser
to reload the page or not caching it at all.
This because the contents of the page is
dynamic and consists mostly of information
from included files. Some links are also
marked as 'new' if the contents of the
pages has changed since the users last
visist.


I tried the expire tag. It worked for Netscape,
but not for IE and Mozilla. We tried some
java-script code also, but that
code was not cached... Frown


How do I force the browser to reload the
page from the server every time and not
look in it's own cache?



GeneralRe: Can't get expires to work...
The Haus
10:09 20 Jan '04  
Try using the <META HTTP-EQUIV="cache-control" CONTENT="no-cache"> tag on the pages you want to reloaded every time.   It'll add more overhead, but at least that way you'll be certain the visitor is getting the most current version.
GeneralRe: Can't get expires to work...
JVMFX
8:39 23 Mar '06  
From what I have read, you need to use HTTP headers for that. There are some good web pages with info about caching. One I came across even suggested that to work with IE you need to add another <head> section at the bottom of your page.

Anyway, here's a link which has some good information. It's the web, so this link may go bad someday. If you find this page useful, you may want to save it off or print it or something.

http://www.mnot.net/cache_docs/


Last Updated 27 Jun 2002 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010