HTML 015 - Meta Tags
PDF

Assuming you want your website to gain popularity, it is recommended you use Meta tags. These tags allow you to create keywords that search engines can use to index your site. This way your website will rank higher up on web searches. This gives your site a better chance of being found by someone looking for something that could be on your site. An example of meta tags is given here:

<meta name="keywords" content="dark scarab, animations, images, tutorials" />

Meta tags will almost always have the name and content attributes in them. The name of the meta tag will define what the content of the tag means. In this case the words defined in the content are the keywords of my webpage. You can put as many keywords as you like. Another way to help your search engine ranking is to make the name attribute 'description'. Then in the content you would type up the description of your site.

<meta name="description" content="Dark Scarab is the place to go for HTML tutorials!" />

In many cases both of these are used on web pages. Other values you can use for the name attribute include author, owner, revised, copyright, rating, robots, refresh, and revisit-after. Almost all of them are fairly self explanatory. When you use any of these name values you will use the content attribute to define it.

CodingWhat it is...
<meta name="author" content="John Smith" />Names the Author of the web page.
<meta name="revised" content="10/10/10" />Date when your site was last updated.
<meta name="copyright" content="Copyright © Bob" />The copyright information of the site.
<meta name="rating" content="General" />Rating of your site: 14 Years, general, mature, restricted, or safe for kids. Similar to movie ratings.
<meta name="revisit-after" content="7 days" />The time between each update.
<meta name="owner" content="Jim" />Owner of the site.
<meta name="robots" content="webpage.html" />Pages that robots aren't allowed to search through.
<meta name="refresh" content="5;URL=http://www.url.com" />Refreshes page after x number of seconds to the URL that is named.

These are not all of the possible names you could use but these are the most commonly used after keywords and description. The name attribute is not the only one you can use in conjunction with the content attribute. You can also use the http-equiv attribute. You can define this attribute with date, expires, last-modified, location, refresh, content-type, and content-length.

CodingWhat it is...
<meta http-equiv="date" content="5/5/05" />When the page was created.
<meta http-equiv ="expires" content="5/5/12" />When the page is considered obsolete.
<meta http-equiv ="last-modified" content="5/5/06" />Date when the page was last modified.
<meta http-equiv ="location" content="http://www.url.com" />Full URL of the pages location.
<meta http-equiv ="refresh" content="10" />Time in seconds between each page refresh.
<meta http-equiv ="content-type" content="text/html" />MIME type of your web page.
<meta http-equiv ="content-length" content="2123" />File size in bytes.

Some of these define the same thing as ones with the name attribute. There is a perfectly good reason for this. The http-equiv attribute defines HTTP header information for the browser while the name attribute is used for the search engine robots. They do quite different things so if you just want to get higher search engine ratings you will probably stick with the name attribute.

Now you know how to use the meta tags but I haven't told you where to put it. Everything within the meta tags are not meant to be shown in the viewing window of your web browser. They are meant to give the browser or search engine robots information about the web page. So rather than putting these tags within the body tags you will put them within the head tags:

<html>
<head>
<title>My Web Page</title>
<meta name="author" content="John Smith" />
<meta name="keywords" content="html, website, meta, tags" />
<meta http-equiv="refresh" content="10" />
</head>
<body>
Stuff in you web page goes here.
</body>
<html>

The above shows the use of many meta tags giving the author and keywords of the site. It also tells the browser to refresh the page every ten seconds. You can add as many meta tags into your head tags as you like. The more you use the easier it is to get people to your site through search engines. However, do not use the lists above as the only possible choices. There are many different name values and http-equiv values that you can use. Many of them depend on the browser. The ones listed here are just the most common ones.