Error » Certification & Programming center Error !! » Programming tutorials » Basic Meta Tags

Programming tutorials All Knowledge Info and links to posted here

Post New Thread Reply
  Basic Meta Tags
LinkBack Thread Tools Display Modes
Old 14-Jan-2007, 10:00 AM   #1 (permalink)
Administrator
 
Anilrgowda's Avatar

Posts: 18,720
Join Date: Jan 2006
Rep Power: 10 Anilrgowda is on a distinguished road

IM:
Default Basic Meta Tags

Basic Meta Tags

Meta tags are important tags that should be included in the <code><head></code> of your web page document (that is, between the opening and closing head tags). They generally contain information for the browser - how to render the page, who made it, a description of it, etc. This information is also collected or used by bots when indexing your pages for search engines.
Meta tags are usually written with "pairs" of attributes — one part telling the browser what the meta tag is about, and the other explaining the content of the meta tag. Types of meta tag are usually defined by the <var>name</var> or <var>http-equiv</var> attributes, depending on whether the meta tag has a name, or is connected with an HTTP header. These are the most common meta tags and how to use them...
Content-Type

The most common — and most frequently discussed — meta tag is content-type. Content-type controls how your pages are delivered and is often used in conjunction with the right DOCTYPE. The most common content-type is <var>text/html</var> delivered with the HTML 4.01 DOCTYPEs. Only — because of flaky browser support — XHTML pages with the XHTML DOCTYPE also get delivered as <var>text/html</var> instead of <var>application/xhtml+xml</var> which makes the browser parse the code as HTML making any XHTML pretty redundant (not to mention forgiving: allowing errors that serving a page as XML would not allow). Which content-type you should use to be "right" is a long and often boring road which I really can't be bothered to travel down — I always use <var>text/html</var> irrelevant of the doctype. So, techno-babble aside your content-type meta tag should look a little like:
For HTML users:
<code><meta http-equiv="content-type" content="text/html; charset=utf-8"></code>
For XHTML users:
<code><meta http-equiv="content-type" content="text/html; charset=utf-8" /></code>
(utf-8 is the recommended character set to be used with XHTML, I use it because it's the easiest to remember.)
Description

The meta description tag is quite important in identifying your web page. Admittedly, it doesn't carry the same weight with search engines as it used to, but descriptions ARE searchable. By using a unique and identifying description accurate for each page, you are more likely to rank higher for keywords found in the description/page than if you used a generic description on every page of your website. Search engines often use the listed description underneath a page's title in the results of a search too, so don't forget to make the page sound good!
For HTML users:
<code><meta name="description" content="a descriptive tutorial on basic meta tags"></code>
For XHTML users:
<code><meta name="description" content="a descriptive tutorial on basic meta tags" /></code>
Keywords

Keywords are also dying when it comes to ranking in search engines, but are important in the identification of pages within a website. It hasn't been proven whether all search engines have ditched them in favour of more complex algorithms so add them anyway. You can specify as many keywords as you like (although, apparently, Google blacklists people for "keyword stuffing") and these must be separated by commas:
For HTML users:
<code><meta name="keywords" content="html, xhtml, meta tags, content-type, keywords"></code>
For XHTML users:
<code><meta name="keywords" content="html, xhtml, meta tags, content-type, keywords" /></code>
Controlling Bots/Robots

If you're one of those strange people that doesn't like the idea of search engine robots spidering your web site, or want to block certain pages from being spidered, you need the robots meta tag. Using this meta tag you can control whether or not a page is indexed, and whether or not links on a page are followed. The default behaviour is "all" — all pages are indexed and all links followed — but you don't need to specify a robots meta tag just to tell it this. Let's see the possible combinations:
For HTML users:
<code><meta name="robots" content="all,none,index,noindex,follow,nofollow"></code>
For XHTML users:
<code><meta name="robots" content="all,none,index,noindex,follow,nofollow" /></code>
While it is possible to use multiple directives separated by commas as above, it makes no sense to use them all or to have something like "all,none". Unless you want something like "index,nofollow" or "noindex,follow" I suggest ignoring this tag.

Anilrgowda is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
   


   
Post New Thread Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -8. The time now is 12:48 PM.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

DMCA Policy

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228