Jump to content
xisto Community
HTML_Guru

Html Meta Tags Tutorial -What it is/does; how to utilize it-

Recommended Posts

Just wanted to add that the generator tag is absolutely useless bit-waste for the author. Some sourcecode creators (wysiwig) may include it by default, but that does not mean, that it has any use, except them being able to find out how popular the websites are that were created with their software.+ the charset tag: it is not really necessary. the web browser takes the charset information from the apache headers that are sent when the page is submitted, so the meta-tag will be overriden.You only need it when viewing your site offline, because then there is no charset-sending webserver in the back.[LINK=http://forums.xisto.com/no_longer_exists/ (German)[/link] provides a good soure on all available meta tags and how important they are. I'll translate later, gotta go now.

Share this post


Link to post
Share on other sites

Please merge posts!

 

There are loads of meta-tags available, but because in the early stages of the internet people did something, that you could call meta-tag spamming, search engines tend to ignore (most) of them and now judging the content.

The ones HTML-guru mentioned are most important (except generator), but there are a lot more.

 

By the way, you have to distinguish two types of meta-tags: <meta http-equiv="forexamplexcharset" content="something" /> and <meta name="forexamplexcharset" content="something" />

If you are wondering why I end the tags with /> and not just with >: this is because I write XHTML conform. If you are using the HTML-DTD (transitional/strict) this is not for you. write like you used to then

The ones with the 'name' in them are for the clients, this means they are read only by the browser/search engine. The ones with 'http-equiv' in them are supposed to speak to the web server. Actually they don't, because servers don't read them out any longer. Nowadays you could probably say, that they are the ones that "do" something (like changing charset, redirecting, etc.) and the ones with 'name' are just read out for some informative purpose.

 

But now let's get to the bloody point, enough general talk:

first the 'name' ones, the informative ones:

name='date' content='2001-12-15T08:49:37+02:00' --> when this site was changed the last time. The format is self-explanatory. You can also leave out the T and everything behind it.

name='robots' content='noindex' --> control robots. also possible with robot.txt. Possible values: index, noindex, follow, nofollow, all. nofollow and noindex can be combined. follow + index=all.

 

now the 'http-equiv' ones, the ones that actually do something.

http-equiv='expires' content='0' --> This makes that the file will be loaded from the original server in every case, so it won't be cached.

http-equiv='cache-control' content='no-cache' --> mystic thingie, that you can find on the internet. should do the same as the above one, but it is not "real"

http-equiv='pragma' content='no-cache' --> another one

http-equiv='content-language' content='en-us' --> pretty clear, eh? doesn't actually do anything for browsers I know.

http-equiv='content-type' content='text/html;charset=utf-8' --> specify what can be found in the document and what charset to use..

http-equiv='Content-Script-Type' content='text/javascript' --> don't know what use it has, because you specify it for the specific fields too..

http-equiv='Content-Style-Type' content='text/css' --> see above

http-equiv='expires' content='date' --> same as the other expire, but for a specific date. you can also put in the seconds after which the caching client should load from server again.

http-equiv='refresh' content='5; URL=http://forums.xisto.com/no_longer_exists/; --> a deprecated way to refresh the current site automatically or to lead to another site. you should not rely on this working (even though popular browsers support it). always note a normal link and preferably do stuff like this with PHP headers for example 301 for permanent redirects. that's better for your search engine stats too. The 5 is for seconds of course

PICS - a w3c standard for adult stuff

http-equiv='set-cookie' content='cookiename=cookievalue; expires=Sun, 01 Jan 2006 00:00:00 GMT; path=/;' --> not actually sure if this works. self-explanatory.

 

It is not over yet, fellows, there are many more, for example the

Dublin Core (DC) specifications, which are good but widely ignored and the possibility to note down a profile in the head element.. but hey I think we've got enough for today, right?

Oh, I should add still that you can add a lang-attribute to the description or keyword tags, for example:

<meta name="keywords" lang="de" content="Ferien, Griechenland, Sonnenschein"><meta name="keywords" lang="en-us" content="vacation, Greece, sunshine"><meta name="keywords" lang="en" content="holiday, Greece, sunshine"><meta name="keywords" lang="fr" content="vacances, Grèce, soleil">

Feel free to ask questions back!

Share this post


Link to post
Share on other sites

ruben,

Thanks for the extra tidbits!

Yeah, as you notice, I didn't post every META tag, mainly due to the fact that I find some unnecessary, and some - I don't even know of.

However, you spoke of how the CHARSET META tag is not necessary; however, in a sense, it is. See, for a website to be properly validated - for instance, XHTML conformed, etcetera, there needs to be a few mandatory tags; one, being the CHARSET tag. The CHARSET tag can properly identify the encoding for the browsers, and so it can be properly validated.

In XML documents, one can include the XML doctype, but this does not remove the need for the CHARSET META tag.

For more info, please check out validator.w3.org

Hope that helps!

Share this post


Link to post
Share on other sites

Oh, thanks for clearing that up, I didn't know it is mandatory.I always write it because I also look at my sites offline, therefore I never noticed.I know, the tags I mentioned are not the creme de la creme of meta tags, but some of them are actually useful (especially the very popular expire and refresh tags)

Share this post


Link to post
Share on other sites

I just found this tutorial. I didn't realize what <META> tags really were about til a little while ago. But I thought that all search engines used them? Since Google doenst use <META>, how do you get noticed? Anyway, about the tutorial. It was extremely informative to me. I knew nothing of them, except what they did. Now I will know how to use them when I need them.

Share this post


Link to post
Share on other sites
regular expression codeHtml Meta Tags Tutorial

Please help me for the following task.

I need to extract the destination attribute in the <a> (anchor tag).

<a href="http://www.dreamincode.net/forums/showforum76.Htm Help</a>

from the above tag I need to extract only the  http://www.dreamincode.net/forums/showforum76.Htm. Can u give me the regular expression code in php for do this.

-question by Naveenkumar

Share this post


Link to post
Share on other sites

Well there is lot of discussion going on, on these meta tags. Google has declared that it won't be following meta tag keywords, but other search engines may use it. So, without keywords how should we seo our blog. What are the new methods to cope up with changes made by Google.

Share this post


Link to post
Share on other sites

takerraj, it depends on how many search engines you want to please and get indexed. There are many other ways to optimize the content for search engines, the first one is good content.Using clean urls, to let the search engine index properly. Its even better to have the content title in the url. As search engines give higher priority to the url name too. Checking the source code of output html if the site is using a content management system. I generally like to put the content on top and navigation markup at the bottom of the page. There are many views by people on this issue.When targeting for specific keywords, let those keywords flow freely through the article, put spaciously apart, so as not appear like spam.

Share this post


Link to post
Share on other sites

Well contrary to what most people believe there are rules when it comes to meta tags. Like the number of words, keywords used, total character length of the values of metatags, and repetition of words.Every search engine out there has some form of algorithm (almost always proprietary) when i comes to evaluating meta data in relation to the web page, the site, linked sites, and content.And it's interesting to note that the algorithm is always changing. The architects always factor in trends, hacking, spamming, and other web search bumping tactics. Also some companies also have an interesting in generating revenue by various search marketing programs.If you are interested in meta data some more then you can always view the source of web pages you look up via search engines. This will give you an idea of what works, and what doesn't. It also doesn't hurt to see what your competition is doing.Sorry I can't delve to much into this topic cause the book I read about it was returned to the library. :DLevimage

Edited by levimage (see edit history)

Share this post


Link to post
Share on other sites

To add my two cents, google is paying attention to meta tags, if you noticed in the google results google shows links with what is written in <meta name="description" content="" /> I think if it's not present it looks into <title></title> content.

Also html meta tags is great for simple html pages, most of dynamic pages use somekind of headers and send them, but sometimes a simple html page can't use headers and apache might send wrong headers by default, so meta tags is the way to show the browser what kind of page it is, what style it is using and etc.

Google is not the only search engine, it's good that it is not using the meta tag keywords, but some pages which indexes different domains and sites are using keywords, so I think it's better to use them, just to keep them simple as possible.

I always use generator, author meta tags and others which are required, also sometimes to control your pages you can control robots with robots.txt and with meta tags, which is sometimes really needed. For some pages, I always use the meta redirection, it's good for sending files or wanting the site to redirect afetr some time, it's way better than doing it with javascript. Therefore, those sites which only use:

<html><head> <title></title></head><body></body></html>

Without the meta tags, they save bandwidth, they usually don't miss anything to much, but I prefer to use meta tags.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.