Meta Data

Meta data is information about your web page that doesn't appear within the page body itself. The most essential piece of meta data has its own separate tag <title> that we met right back in the first tutorial (that's how important having a title on your page is). The other meta data associated with your page are not important enough to have their own tag and so all share a single tag <meta> and use attributes to identify what sort of data the tag contains as well as a second attribute to contain the data. Here are some examples of some meta tags.

<meta content="page description" />
<meta content="one,two,three" />
<meta content="Stephen Chapman" />
<meta content="Felgall Pty Ltd" />
<meta content="index,follow" />
<meta http-equiv="Content-Type"
   content="text/html; charset=iso-8859-1" />

All of these except the last one are simply providing information about the page which may be used by automated processes that visit the page. There are a number of further values that can go in the name attribute,in fact anything at all can go there although if you invent your own values then you will need to write your own custom processing that makes use of those values or you are just making your page bigger for no purpose. With each value that name can have the content attribute will contain the actual meta data identified by the name.

What use gets made of this data depends on what the value in the name is. For example soe search engines when they spider your site to add the pages to their search results will use the content of the description meta tag as the description of your page in their search results. Search engines also used to use the keywords meta tag to help them to identify what the page was about but this was badly abused by people trying to cheat their way to the top of the search results and so that meta tag is now ignored by all the major search engines (I still include that on all my pages though as the search facility that I wrote for searches internal to my site uses those two meta tags as the fields to search when determining what pages to include in the results - muwch quicker than trying to search the full content of thousands of pages). The robots meta tag is also an instruction to some search engines to inform them whether they should list the current page and whether they should follow the links on the page to find other pages to list.

Other meta tags are intended more as comments. The author and copyright meta tags are useful for reminfding people who are viewing the page source that your page is subject to copyright. Almost all of the content of the web is subject to copyright but there is a fairly large group of people who seem to assume that it isn't and so taking any opportunity to remind people that your page is subject to copyright is worthwhile.

The last of the meta tags I listed above had an http-equiv attribute instead of a name. While a web page itself is split into head and body sections the HTTP protocol passes the entire page content behind a series of headers of its own which identify what type of content that it is, what characters to use etc. The http-equiv attribute allows you to specify values within your page as if they were in those HTTP headers. This will only work for some HTTP headers though as there are some that will only work if acted upon before the content of the page starts to load and the meta tags can't be acted upon before they are loaded.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow