Forum Moderators: open

Message Too Old, No Replies

somebody explain meta tags to me

meta tags explanation

         

krikri

4:53 pm on Nov 8, 2003 (gmt 0)



Sometimes some source code for browsers contain the following :

<META NAME="keywords" CONTENT="drinks">
<META NAME="description" CONTENT="">
<META NAME="robots" CONTENT="All">
<META NAME="robots" CONTENT="FOLLOW,INDEX">
<META NAME="ROBOTS" CONTENT="NOARCHIVE">
<META NAME="GOOGLEBOT" CONTENT="NOARCHIVE">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="distribution" CONTENT="Global">
<META NAME="audience" CONTENT="All">
<META NAME="abstract" CONTENT="">
<META NAME="summary" CONTENT="">
<META NAME="classification" CONTENT="general">

I dont understand the folowing

content - nothing was typed
robots - why robot, why all
why follow,index
what is googlebot and why no archive
why revisit after 7 days? instrcution to the googlebot?
I dont undersatnd - audience, abstract, and classification
why summary is empty.

i expected to see author name but its not there. thanks.

Shannon Moore

6:08 pm on Nov 8, 2003 (gmt 0)

10+ Year Member



Lots of good information on individual meta tags and meta tag usage is available here on WW. Enough to eat a day up while reading & learning, I wager!

WW Search for "meta tag":
[google.com...]

troels nybo nielsen

7:21 pm on Nov 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> content - nothing was typed

I have a couple of such pages. I use templates that have this meta tag and sometimes I get a little too busy and upload a page before I have written something here.

Some webmasters may use a WYSIWYG editor and have this meta tag as default in their pages without actually knowing it.

> why revisit after 7 days? instrcution to the googlebot?

Yup. And to bots from other search engines. AFAIK this tag is completely useless. The bots come when they come.

> i expected to see author name but its not there.

Same problem as in the content meta tag.

g1smd

12:56 am on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your document should begin with a !DOCTYPE (tells the browser what sort of HTML is in the file) and a title element:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> Your Title Here </title>

For your page to actually be valid you MUST declare the character encoding (lets the browser know whether to use A to Z letters (latin), or Chinese, Japanese, Thai, or Arabic script, or some other character set) used for the page, with something like:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

There are also other schemes such as UTF-8 and many others.

It is also a good idea to declare what language the page is in, using:

<meta http-equiv="Content-Language" content="EN-GB">

The language and country codes come from ISO 4217 and ISO 3166. This is useful for online translation tools as well. Change the "en" and "gb" to whatever language and country you need.

You need the meta description tag, and it is useful but not vital to have a meta keywords tag:

<meta name="Description" content=" Your Description Here. ">
<meta name="Keywords" content=" your, keyword, list, here ">

The last parts of your header should have your links to external style sheets and external javascript files:

Use this if the stylesheet is for all browsers:

<link type="text/css" rel="stylesheet" src="/path/file.css">

Use this for style sheet that you want to hide from older browsers, as older browsers often crash on seeing CSS:

<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"> @import url(/path/file.css); </style>

Use this for the javascript:

<script type="text/javascript" language="javascript" src="/path/file.js"></script>

End the header with this:

</head>
<body>

and then continue with the body page code.

It is as simple as that.


Code within the page:

I use: <a href="somepage.html" title="some text here"></a> for links.

I use <img src="somefile.png" alt="some text"> for images.

Headings are done with <hx></hx> tags, properly used from <h1></h1> downwards.

troels nybo nielsen

6:45 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> <meta http-equiv="Content-Language" content="EN-GB">

There seems to be differing opinions about the best way do identify the language of a document. I have been using meta tags for this purpose for some time, but am now in the proces of removing them.

In stead I put this information in

<html>

Like this:

<html lang="en">

I am not sure why this is better, but I have seen it recommended on several websites run by rather competent persons. I have not seen them argue against the other possibility. They simply present this one. Any opinions?

encyclo

7:28 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most meta tags are completely unneccessary and can be removed - all they do is move your content further down the reading list for the search engine bots. For example, the robots meta tag should be removed and replaced with a robots.txt file in the root directory. Keywords are ignored by all major search engines and are therefore simply a waste of bandwidth.

There seems to be differing opinions about the best way do identify the language of a document.

<html lang="en"> is fine, and can replace the meta tag. However - there is a better way, especially if your site is unilingual - set the default language in the server configuration. If you're using Apache, add this to httpd.conf or to your root level .htaccess:

DefaultLanguage en

(Replacing en with your appropriate country code if your site is not in English).

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

You can get rid of this one in the same way - add this to httpd.conf or .htaccess:

AddDefaultCharset ISO-8859-1

On a multi-language / multi-charset site, you can also use <File> or <Directory> to specify, for example:

<Directory /english/*>

DefaultLanguage en

AddDefaultCharset ISO-8859-1

</Directory>

<Directory /french/*>

DefaultLanguage fr

AddDefaultCharset UTF-8

</Directory>

Mohamed_E

8:02 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many thanks, encyclo, for a very helpful post!

DefaultLanguage en

Works beautifully, and as a bonus shows up in the header so I can check that it is for real :)

AddDefaultCharset ISO-8859-1

Currently I am using:

AddType 'text/html; charset=ISO-8859-1' html

I suspect that the AddDefaultCharset is more general? Thus, for example, I am currently not saying what charset I use in my .js files?

<added>Checked the headers of a .js file, and sure enough, no charset! Again, many thanks!</added>

pageoneresults

8:15 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Keywords are ignored by all major search engines and are therefore simply a waste of bandwidth.

Hmmm, not too sure that is a true statement. There are indications that some SEs are still utilizing the keywords tag in certain instances, including Google.

pageoneresults

8:17 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use this for the javascript:

<script type="text/javascript" language="javascript" src="/path/file.js"></script>

That can be shortened to...

<script type="text/javascript" src="/path/file.js"></script>

The language attribute is now deprecated.

pageoneresults

8:19 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

It has been proven that using a shortened DOCTYPE is just like not having one. Without the DTD reference, the browser goes into Quirks mode and therefore negates the use of the DOCTYPE. The full DOCTYPE to use will depend on which one you choose. For HTML loose, it is...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Mohamed_E

8:25 pm on Nov 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Interesting ...

I just added


AddDefaultCharset ISO-8859-1
DefaultLanguage en[/pre]

to my .htacess, which already had
[pre]
AddType 'text/html; charset=ISO-8859-1' html

When I use the header checker on index.html, I get:

Content-Type: text/html; charset=iso-8859-1
Content-Language: en

but when I fetch the headers of calc.js I only get:

Content-Type: application/x-javascript
Content-Language: en

with no charset :(

Is my syntax correct (the segment from the .htaccess file has been cut and pasted)?

encyclo

1:57 pm on Nov 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



but when I fetch the headers of calc.js I only get: <snip> with no charset :(

I assume that the

AddDefaultCharset
only applies to files served as
text/html
. I'm not aware that you need to specify ISO-8859-1 for .js files as javascript is always in that charset, and never includes non-latin characters to my knowledge.

The advantage of

AddDefaultCharset
over
AddType
is that the former applies to files served as
text/html
irrespective of file extension - .html, .htm, .php, .shtml, .asp, etc...

I forget to mention you can also send the Content-Language and Content-Type as headers via a scripting language, eg in PHP:

<?php

header('Content-Type: text/html; charset=ISO-8859-1');

header('Content-Language: en-ca');?>

Again, avoiding the need for the meta tags. I found out in another thread that you can also send PICS label information in the same way.