
When a client application (browser) requests an HTML document, a web server normally passes the document with a response header added at the beginning. This header is seperate from the HTML HEAD element and includes information the client needs to interpret the document.
The meta tag can have three attributes:
content http-equiv name In general terms, only use the meta tag when there isn't another HTML tag you could use to supply the information.
You can specify what information should be included in the response header by using the HTTP-EQUIV attribute. To do this you must assign a value (in the form of a name) to the attribute and supply the information relating to that name in the content attribute.
Use the name attribute in place of the HTTP-EQUIV attribute when you do not have (or know of) a valid header name.
Meta Tags and Search Engines
You can use meta tags to help the search spiders index your site more accurately. This means that, in theory at least, your site will show up in search service results when someone searches for the topic that your site covers.
There are a couple of common misconceptions about meta tags, and both revolve around using meta tags to help the search spiders index a site. First, is that your page must have meta tags in order for the spiders to find and index it. Not true! Spiders find your page whether or not it has meta tags. The tags do, however, help some spiders index it in the way you want it indexed.
Second, is that you can control the exact way your site is indexed by using some magic formula of meta tags. Wrong again. For some spiders the meta tags provide guidelines, but the content of meta tags is weighed with other factors, and each spider uses meta tag information a little differently.
The bottom line for meta tags and site searches? If you don't care how your site is indexed, if your audience already knows where to find you, and you don't plan on indexing your own site, don't worry about adding meta tags for search spiders. But, if you are trying to reach people who don't know you are out there, take a little time and think about the meta tags that will help describe your site and its content the best. It is worth the effort.
Adding Meta Tags for Search
Adding meta tags for search spiders to find is quite simple. You'll place them in the header area, one after another.
The basic meta tag for search looks like this:
<meta name="xxx" content="xxx"> The first attribute is name. You use this attribute because you are using the meta tag to define a set of information. The two most common values for this switch are "description" and "keywords." Most search spider recognise these two values.
The second attribute is content. It tells the browser what data is stored in the meta tag. For example, the content value for a description meta tag would be a brief description of the page. The content value for a keywords meta tag would be a list of possible search words or phrases, each separated by a comma.
The result of adding these tags is, ideally, that the search spiders will describe your page the way you want it described, and display it as a search result high on its hit list.
Note that using meta tags is a particularly important consideration if you use frames on your site, since there may be nothing on a frameset page except for a frameset -- from which a spider can't find a description or keywords, and therefore has no idea how to index it.
Description
<meta name="description" content="a short, but appealing, description of the page, usually less than 200-250 characters long."> Normally, a search spider will use the first few words on your page as a sample of what the searcher will find there. However, if you insert a description meta tag the spider will use the value in the content switch as the page's description instead. For example, a description meta tag for a software company might look like this:
<meta name="description" content="Software Inc. offer the best deals on word processing and database packages in the UK."> Keywords
<meta http-equiv="keywords" content="words, simple phrases, items of interest, possible search terms"> The keywords meta tag lists words or phrases that a searcher might use in looking for your topic. The more words that match, the better the odds are that your site will be in the top 10 matches. For example a keywords meta tag for a software company might look like this:
<meta http-equiv="keywords" content="computer, software, word processing, database, microsoft, access, oracle, word, dtp, uk"> Now, the odds are improved that someone looking for "word processing software in the UK" will find your site.
Abstract
<meta name="abstract" content="A longer, more detailed description of your site; an academic style abstract."> Sometimes a spider will also record an abstract, along with a description. The abstract is simply a longer description that summarizes the page. For example an abstract meta tag for a University Research Department might look like this:
<meta name="abstract" content="The area of Neural Networking is studied in detail at this growing department. We have experts in the field dealing with all areas of research. We regularly publish papers and visit conferences worldwide. See our site for a comprehensive glossary of members and their current research and take part in our regular on-line discussion groups."> Now readers who use a service that supports the abstract meta tag will see a full and complete summary of your page. Please note, however, that abstract is not widely supported at this time.
Author
<meta name="author" content="Your Name"> The author meta tag lets you identify the author of the page. Sometimes this gets used; most often you'll be including it for your own benefit or for the benefit of anyone looking at your code. An author meta tag might look like this:
<meta name="author" content="Jane A. Doe"> Generator
<meta name="generator" content="Program Name"> Like a little advertisement, some HTML page editors automatically include a generator meta tag in every page they create. A typical generator meta tag might look like this:
<meta name="generator" content="Microsoft FrontPage 4.0"> Avoiding Indexing
You can also use meta tags to avoid having your page indexed. If your page is created for a small group of people, if you'd rather not have random browsers hitting your site, or the page may be part of a frameset, or if your site is live but still under construction or otherwise not ready for *prime time* viewing, you might not want it to be indexed.
You avoid indexing by using a meta tag named robots. Not all spiders honor this meta tag, but several do and more are planning to support it. Robots looks like this:
<meta name="robots" content="noindex"> Using a robots meta tag and setting its content value to "noindex" tells the search spider to skip this page when it builds its index.
Refreshing / Slide shows
You can also use meta-information to specify the amount of time before the browser should request a file again, useful if you have webcams, for example, where a new picture is being taken every few seconds:
<meta http-equiv="refresh" content="30"> In this case the page is refreshed (fetched from the server) automatically every 30 seconds.
You can take the refresh one step further and instruct the browser to refresh to a different page by inserting the relevant URL:
<meta http-equiv="refresh" content="10;url=http://www.brunel.ac.uk/"> In this case the page will change after 10 seconds and will load up the home page for Brunel University.
The refresh attribute can also be used to load a sound file after a specified amount of time, just point the URL to the correct sound file.
If you expand on the previous example you could have a series of pages loading in sequence, like a slide show or a countdown.
See the example.In this example the following meta tags are used:
slide1.htm: <meta http-equiv="refresh" content="1;url=slide2.htm"> slide2.htm: <meta http-equiv="refresh" content="1;url=slide3.htm"> slide3.htm: <meta http-equiv="refresh" content="1;url=slide4.htm"> slide4.htm: <meta http-equiv="refresh" content="1;url=slide5.htm"> slide5.htm: <meta http-equiv="refresh" content="3;url=meta.htm">
© 1999 Nix Designs