HTML Meta Tags (HTML Tutorial part 26)

১১/১৮/২০১১ ০৮:৪৪:০০ AM | | 0 comments »

Meta tags are used to supply information for search engines that will not be seen by the web surfer unless they were to view your web site's HTML. In the past, meta tags were a primary way for your site to be recognized by web spiders, but the internet community abused the meta tags to artificially increase their ranking in the search engine databases. Nevertheless, you should still include meta for those search bots that do recognize them, allow your site to be included in their search engine.

Keywords Meta Tag

Keywords or phrases are placed in this meta tag's content attribute. You should specify the most popular search terms you believe someone would use to reach your web site. A few years back, you could spam this meta tag with any and every keyword possible to gain ranking on search engines. Repeated words, or words that do not pertain to the content of the site will not benefit you or those using a search engine. Here's an example of proper usage for a site.

HTML Code:

<head>
<meta name="keywords" content="keyword, key keywords, etc" />
</head>
name defines what type of meta tag being used. Note that the keywords are separated by commas.
An example of the keywords meta tag for Tizag.com would be as follows.

HTML Code:

<head>
<meta name="keywords" content="HTML, XHTML, CSS, tutorials, tizag" />
</head>

Description Meta Tag

As you might have guessed, this tag will show a brief description of the web page to a search engine. Your description should be a sentence or two about your web site. Keywords that appeared in the keyword meta tag should appear here as well.

HTML Code:

<head>
<meta name="description" content="Tizag contains webmaster tutorials." />
</head>
Description and Keywords tags are very similar, and they should be. As mentioned above if they do not match, you may be ignored or blocked by some search engines. Be careful.

Revised Meta Tag

The revised meta tag records when the last update was done to the site.

HTML Code:

<head>
<meta name="revised" content="Happy New Year: 1/1/2003" />
</head>

Refresh Page and Redirect

Later down the road, you may need to redirect traffic to another domain. A common reason might be that you have just purchased a better domain name and would like to retain your old visitors, yet still use your new domain. With the refresh meta tag you will be able to redirect visitors to the web site of your choice.

HTML Code:

<head>
<meta http-equiv="refresh" content="10; url=http://www.tizag.com" />
</head>
Above shows refreshing Tizag's home page every 10 seconds. A quick refresh may be necessary for news, stocks, or any other time-sensitive information. The most common use for this type of meta tag, however, is redirection. To redirect a viewer automatically, just change the URL to the new site as shown below. This code will send your visitors to espn.com after being at your site for five seconds.

HTML Code:

<head>
<meta http-equiv="refresh" content="5; url=http://www.espn.com" />
</head>