Welcome to WebmasterWorld Guest from 54.197.168.70

Forum Moderators: incrediBILL

How to use meta tags in html ?

   
11:14 am on Apr 11, 2013 (gmt 0)



At many places i have seen lot many stuff in meta tags like keywords, description, author, robot etc. What are main meta tags. I am bit confused, pls help
7:51 pm on Apr 11, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Short answer: If you don't know what it does, don't use it.

There is one meta tag that you absolutely must have. Exact form depends on html version, but it will look something like

<meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8">

or, ahem, whatever charset you actually use. Your name strongly suggests that UTF-8 is the best choice.

Other meta tags are added to meet specific needs. For example

<meta name = "description" content = "blahblah".

Search engines may choose to display the content of this meta tag instead of a selection from the page text-- especially if it happens to contain all the search terms close together. (But note that you cannot search for the exact text of a meta description.)

<meta name = "robots" content = "noindex">

When a search-engine robot sees this tag, it will not mention the page in search results. (Note again that this is different from excluding a page in robots.txt: there, the robot knows that the page exists-- and might even show it in search results-- but can't see its contents.)

Some people use
<meta name = "keywords" content = "spam viagra spam porn spam cialis spam hardcore spam">


More to the point, some search engines still read them.

I suspect the moderators will not care for that last example.
8:58 pm on Apr 11, 2013 (gmt 0)

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If used, keywords and keyword phrases should be separated by commas (that's from back when Yahoo! was taking a peek at them).
11:43 pm on Apr 11, 2013 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



<meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8">
or, ahem, whatever charset you actually use. Your name strongly suggests that UTF-8 is the best choice.

In (x)html5 make that:
<meta charset="UTF-8" />


And btw: put this as the very first before anything else in the <head> ... saves the browsers that might start to guess.
1:15 am on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



In particular: If you put the charset line before the <title> you don't have to revert to entities for any non-ASCII content. (Took me a while to figure this out.) Unless of course your target audience includes lots of people using MS-- Whoops! I mean, of course, antiquated* browsers.


* I don't know when MSIE learned how to read the "charset" declaration, but it's embarrassingly recent.
5:49 am on Apr 12, 2013 (gmt 0)



HTML meta tags are page data tags that lie between the open and closing head tags in HTML code in a document. The Text in these tags not show but simply the page so a browser can understand it
Example # 1
<head>
<title> not need any meta tag write any way </title>
<meta name=”description” content=”Description Here”>
<meat http-equiv=”content-type” content=””text/html;charset=UTF-8”>
</head>
Example # 2
<head>
<meta name=”description” content=”Free Web tutorials”>
<meta name=”keywords” content =”HTML,CSS,XML,Java Script”>
<meta name =”author” Content=”Stale Refsnes”>
<meta charset=”UTF-8”>
</head>
5:56 am on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The character set declaration must be first.

Many people seem to follow this with title, then meta description, followed by links to CSS files, then JS files.
8:21 am on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



character set is not required as a meta tag, as it can be set in .htaccess
8:36 am on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



The information is then lost if someone views the page locally. Belt and suspenders: put it in both places.
10:20 am on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



... there's a logic to that
12:18 pm on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Search engines have ignored keywords in meta tags for years. Don't bother.
8:58 am on Apr 15, 2013 (gmt 0)

10+ Year Member



If you are able to have your server send a Content-Type header, with a charset, these meta tags are superfluous:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">


The Content-Type server header has presedence over the meta tags, so if the server header is already set, these meta tags do nothing. If the server header says something else as the meta tag, the browser responds to the server header, not the meta tag.

I think these meta tags are way overused. I personally don't want people to save my pages locally, so having the meta tags there for that reason is not good enough for me.
10:08 am on Apr 15, 2013 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Well the W3C Internationalization (i18n) Group recommends to always include a visible encoding declaration in a document, because it helps developers, testers, or translation production managers to check the encoding of a document visually.

[w3.org...] :
You should definitely use HTTP header declarations if it is likely that the document will be transcoded (ie. the character encoding will be changed by intermediary servers), since HTTP declarations have higher precedence than in-document ones.

Otherwise you should use HTTP headers if it makes sense for any type of content, but in conjunction with an in-document declaration (see below). You should always ensure that HTTP declarations are consistent with the in-document declarations.

[my bold, although they had more or less the same in the source]
12:05 am on Apr 18, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, satyalok15!


according to the HTML5 specification, these are the Standard metadata names:
http://www.w3.org/TR/html5/document-metadata.html#meta

extensions to this set of metadata names are registered in the WHATWG Wiki MetaExtensions page:
http://wiki.whatwg.org/wiki/MetaExtensions [wiki.whatwg.org]
9:34 am on Apr 18, 2013 (gmt 0)



Now google don't bother about meta tag. According to "Matt Cuts" its not necessary to have meta tags.
10:27 am on Apr 18, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, Rose_Marry!


where does he say that?
was he talking about all meta tags or a specific meta tag?
11:43 am on Apr 18, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



He doesn't say that at all. As I said above, search engines ignore the meta tag for keywords but that's all.
9:24 pm on Apr 18, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Depends what you mean by necessary. To pass validation, your <head> element requires only a <title>. But not many pages have a <head> consisting only of <title>.

The major search engines do heed the "robots" meta. At least "noindex", which is the most important.
11:55 am on Apr 24, 2013 (gmt 0)



Depends what you mean by necessary. To pass validation, your <head> element requires only a <title>. But not many pages have a <head> consisting only of <title>.

The major search engines do heed the "robots" meta. At least "noindex", which is the most important.

i agree this information
4:32 pm on May 6, 2013 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The point about meta tags (in general) is to provide non-display information (title, links to CSS/JS assets, etc). Some are used/referenced by the browser, some by search engines, yet others by your editor or on-server scripts/programs. The only really useless ones are those put in place by the editor. The point is to know what a particular meta tag does, how it is used, and by what. If you can't answer those questions, don't use the meta tag.

And, Welcome to Webmaster World to several of our newer members :)
3:43 pm on May 9, 2013 (gmt 0)

WebmasterWorld Senior Member



So which meta themes are useful these days? And I don't just mean for Google SEO - for example, my understanding is that Bing prefers you include the meta description tag, and in any case (when the engines use it) using it can give you better snippets than the ones the engines auto-generate.

Below is my understanding, but I'd love feedback from others:

"language" - essential
"author" - I've read conflicting accounts on this one. I believe it can't hurt, but may not help?
"description" - see what I said above
"publisher" - I really don't understand this one
"keywords" - no conclusive evidence Google uses it (and they say they don't) and Bing apparently uses it to detect spam, not to rank you. So, more trouble than it's worth?

I know there are plenty of others, but I think these are the more common ones.
4:35 pm on May 9, 2013 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



title: essential
description: good to have, if used as a well-written summary/description of the page and its contents (beware of keyword stuffing)
keyword: meh, for the most part
author: pointless, unless you need it for internal purposes
publisher: see above
anything to do with encoding, content-type, etc: use appropriate server headers instead
language: see above, or use the lang attribute on your html element
all others: there's no solid one-fits-all answer
6:25 pm on May 9, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The description meta tag is the only one I use - I used to use the Content Type meta tag but that now gets taken care of with server headers etc..
7:25 pm on May 9, 2013 (gmt 0)

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I hate to quibble here (he says as he's about to quibble) but <title></title> is an HTML element, not an attribute of a meta element.

And the title element should not be confused with the title attribute, which can be used in any HTML element (with the exception of a handful in HTML 4.01.)
7:41 pm on May 9, 2013 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The <title> tag is, however, itself a "meta tag", which is what this thread was about. But, you're right that it's not a value or attribute of the <meta> tag ...

It's just a habit of mine, and others, when discussing meta tags (in general, as opposed to "the meta tag") to include <title>, especially in response to something like: which meta [tags] are useful these days?

In any case, like you alluded to, it's important to not get things confused (meta vs <meta>, <title> vs title="") ...
8:52 pm on May 9, 2013 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



For clarity, there is a meta tag that is constructed like this: <meta type="title" content="Lore Ipsum" />.

That's one reason that I avoid calling <title>"Lore Ipsum"</title> a "meta tag". It doesn't even have a content attribute. People do get thes consfused, and if you want to be sure that a title is indexed by search engines, then you need to stick with <title></title>.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month