Canonical Element was added a while go in 2009 by Google,Yahoo and Bing as a solution to on-site duplicate content. For eg. if you have the following URLs
all pointing to the same content then using canonical element you can indicate in the html code of the web page which page should be treated as original.
URL Canonicalization, however this does not work across domains. For cross domain content duplication issue – 301 redirect is the solution. Another situation where canonical element is quite useful is with URLs with session id. URLs with session id’s is an issue with many dynamic sites.
One of the common mistakes is not redirecting non-www to www to vice-versa. Search engines treat
domain.com and www.domain.com as separate URLs, so if you don’t set the redirect you are implicitly creating duplicate of your site in the eye of search engine spider. Another major issue to bear in mind is dilution of backlinks.
www or non-www preference could be set in Google Webmaster Central as well. Google Webmaster Central
For WordPress All In One SEO Pack for URL canonicalization provides the option to automatically select and apply canonical link attribute to to the preferred URL of every page.
URL Canonicalization Plugin for Magento,Wordpress and Drupal here Canonical URL Plugin
More Details in this video by Matt Cutts