Did you find this useful?
Socialize it today.


HTML Meta Element

Wednesday, February 08, 2012

Metadata is simply, information about data. In HTML documents, the <meta> element provides information to browsers about the HTML document. Metadata information will not be displayed on the page, but will used by the web browser in some form or fashion. Meta elements are used for various reasons such as adding, keywords, a page description, author of the document, when it was last modified, and other related information. The <meta> element is always placed within the head element as shown here:

<!DOCTYPE html>
<html>
  <head>
    <title>My Web Page Title</title>
    <meta name="description" content="a short description about this web page." />
    <meta name="keywords" content="important words or phrases found on this page." />
  </head>
  <body>
    <h1>Main heading</h1>
  </body>
</html>

Here are some of the more common meta elements you'll be including in your HTML document. There are many more, and you can define your own in a schema.

Copyright

This tag is used to add copyright information to your page.

<meta name="copyright" content="Copyright © 2012, ITGEARED.com ">

Description

Search engines sometimes choose to use description to show them with the results of searches. Having a description will help your users have a better understanding about the page so they would be more likely to click on your link.

<meta name="description" content="This web page is about science, technology, and education.">

Generator

The generator tag is not required, but if you use a web publishing application, the application itself may add this tag to your document.

<meta name="generator" content="My Web Publishing App ">

Googlebot

This attribute informs the Google search engine about indexing, archiving and link-following rules.

  • noarchive - Prevents Google search engine from archiving the page.
  • nofollow - Informs Google that the page can be indexed, but links should not be followed.
  • noindex - Google robots should follow links, but not index the page.
  • nosnippet - Prevent Google search engine from saving snippets and archiving the document.
<meta name="googlebot" content="noindex">

Keywords

Keywords tell the web crawler what the main focus is of the document. It can be used by search engines, although many search engines stopped using keywords with regard to indexing your pages.

<meta name="keywords" content="technology, science, education">

Refresh

The web page will display for a specified amount of time before refreshing or switch to a new URL. Note: for redirecting pages, it is preferable to use a URL rewriting method. Using this meta attribute requires the browser to support it. It may not work for all of your visitors.

<meta name="refresh" content="10; url=http://www.itgeared.com"> [OR] <meta http-equiv="refresh" content="10; url=http://www.itgeared.com">
<html xmlns="http://www.w3.org/1999/xhtml">    
  <head>    
    <title>Web Page Title</title>      
    <meta http-equiv="refresh" content="0;URL='http://anotherhost.example.com/'" />    
  </head>    
  <body>     
    <p>This page has moved to a <a href="http://anotherhost.example.com/">
      anotherhost.example.com</a>.</p>
  </body>  
</html>  

Robots

This tag is not required, but can be used if you want to instruct web spiders on how to, or not to crawl your site. Valid values for the "CONTENT" attribute are: "INDEX", "NOINDEX", "FOLLOW", "NOFOLLOW". Multiple comma-separated values are allowed, but obviously only some combinations make sense. If there is no robots <meta>tag, the default is "INDEX,FOLLOW", so there's no need to use this tag if that is your intention. Other possibilities include:

  • <meta name="ROBOTS" contnet="NOINDEX, FOLLOW">
  • <meta name="ROBOTS" contnet="INDEX, NOFOLLOW">
  • <meta name="ROBOTS" contnet="NOINDEX, NOFOLLOW">

Fore more detailed information about meta and additional attributes, please vist W3.org's page concerning this topic.

Please help us spread the word by socializing it today!

email contact us

Did you find something wrong with the information on this page? Please take a moment to report it to us so that we can continue to improve the quality of the information on this site. Click here to report an issue with this page.



Recommended Books & Training Resources

HTML CSS and JavaScript Editor HTML CSS: The Complete Reference Creating Web Pages Simplified