The Goal
The goal of optimizing your code for search engines is not to "trick" the search engine into thinking your site is about something that it's not. It's about telling a search engine, in no uncertain terms, what you site is about.
Spiders and filters alone don't really paint a very accurate picture of your site. Optimization code, on the other hand, leads the search engine to match your site up with specific queries in your field. This is a service to viewers trying to find a site with your specific content.
There's a big difference between optimization and trickery. Trickery just doesn't work. If you mislead people to you site, they'll just leave. You don't have anything that they're interested in and they'll just move on after spitting at your site. Is this really the traffic you want?
There are two stages in optimizing your pages' code for search engines. In the first stage, you want to make a list of words and phrases that someone would type in to find a site like yours. I call this list "<meta> data" because it goes in <meta> tags as well as many other places.
The second stage of optimizing for search engines is to "deploy" this <meta> data around your page so that a search engine will view it as legitimate content, but your viewers don't actually see it. I mean who wants to read a list of keywords?
One caution up front. If a search engine sees that the majority of the text it reads consists of keywords, especially the same order of keywords, it will assume you're trying to trick the engine and scrap your site. Be sparing with the techniques below.
Developing <meta> Data
STEP 1 -- Determine why people would come to your site. What are they looking for? Who's your expected audience?
STEP 2 -- What queries would these people use to to find a site like yours? What would they type into a search engine? Make a list of these words. Lets call this a "query list". These may or may not become "keywords".
STEP 3 -- Now go to a big search engine like Google or Yahoo! and type in one or two of the words from your "query list". Note the top rated sites and their URLs. Now go to other search engines and repeat this. Make a list of top rated sites. Pay particular attention to those whose URLs keep cropping up near the top.
STEP 4 -- Go to the top rated sites and look at their source code. Look for <meta> tags that contain keywords and a site description. Copy this list. Look at the <title>.
Next save their source code to analyze later. You'll need to finish studying the techniques below to better understand what to look for in their code. Look for recurring keywords and pay attention to the order the keywords are in.
STEP 5 -- Now look at the keywords you found on the top listed sites and your "query list". Put these together for an initial keyword list.
STEP 6 -- Prioritize this list. Put the most descriptive words at the top of the list. Remember which words the top rated sites put at the beginning of their keyword lists. Do not just copy your competitors keyword list. This has negative consequences both with search engines and, possibly, legally.
Pare off the less significant words at the bottom. There are no hard and fast rules as to how long your keyword list should be, but try to keep it around 256 characters or less. That would be an average of more than 30 words -- very generous. You don't have to have that many keywords, but get at least ten. Remember that you can use short phrases as keywords, too. In fact, it's the use of 2-3 word phrases that really locks in a high ranking for specific queries.
For the rest of this article, I'll be using a keyword list for a pet monkey care site: monkeys, pet monkeys, monkey care, feeding monkeys. Notice that I used more phrases than individual words. This is okay because it separates "monkey care" from overall "care". If you use phrases, try to keep them limited to two or three words.
Making <meta> Tags
The <meta> tags are coded in the head of your page(s). Two of these tags are important for search engine ranking. These are NAMEd "description" and "keywords".
STEP 7 -- Make your keyword <meta> tag. You've already done the hard part by making a prioritized keyword list. Make the "keyword" tag like this:
<meta name="keywords" content="monkeys, pet monkeys, monkey care, feeding monkeys">
Not much to the code above. Just add a NAME attribute and set it to "description". Then add a CONTENT attribute and set it equal to your list of keywords. Words and phrases are separated by commas in the keyword list.
STEP 8 -- Now we'll make our "description" <meta> tag for the monkey care site. The big key here is to incorporate as many of the first 3-5 keywords as you can:
<meta name="description content="Care and feeding of pet monkeys">
In this case, I've used all of the keywords in the description. Again, try to incorporate the first 3-5 at least.
Note: You'll hear a lot of clap-trap that search engines don't read <meta> tags anymore because of past abuses. You may even hear this spewed from authoritative references. They're out of date. Obsolete.
The <meta> tag is still read by search engines, but the data is used very differently than it was in the past. It is now used for comparison to trap those attempting to misdirect viewers.
In the early days of the Web, search engines read only <meta> tags for site info. Many webmasters, most notably porn lords, started using any keywords they thought would trick viewers to their sites. In short, they cheated viewers looking for non-porn pages. This almost killed search engines.
An early response by some large search engines was to ignore the <meta> tag and try determining the site's content by looking elsewhere in the page's code. This worked better, but not great.
Today, the bigger search engines do read the <meta> tags, but they don't give them any real priority. They use them to compare to your content to see if you're attempting to "cheat" the search engine. They expect to see some of your <meta> data in the actual content of your page.
So, it's currently important to use <meta> tags for keywords, but you'll fail in misdirecting people if your <meta> data doesn't match up with your page's content. The <meta> data is used for comparison, not accepted blindly as in the Web's early days.
The <title>
STEP 9 -- A page's <title> has disproportionately high significance to just about every search engine. I've not figured out why, but it does. You need to include 3-5 (or more) keywords in your pages' <title> tags.
This is why you sometimes bookmark a page and it's got a mile long name. The webmaster knows you can always pare down the name for your bookmarks/favorites, but you can't bookmark his site at all if you can't find it. A <title> for our monkey site might read:
<title>George's care and feeding of pet monkeys, pet monkey tips, monkey care, feeding monkeys<title>
You've probably noticed sites with titles this long. Now you know why they're that long -- search engine optimization. It still helps the viewer to add a friendly prefix, like "George's" to separate your site from others they've bookmarked. They may not bother to edit your long title.
Hidden Boxes
STEP 10 -- A hidden box is an invisible block of text placed right below the <body> tag of your page(s). You'll put some keywords in this box so it will be read by search engines, but not visible to your viewers.
You can make this box by using the <div> tag:
<body>
<div style="position: absolute;visibility:hidden">
Your "special" coding will go here.
</div>
Make sure to code the STYLE attribute exactly as presented above. Learn more about <div> boxes here.
Now lets put something in our invisible box that will catch a search engine's attention. Remember that spiders don't send back all the text in your code. They target specific types of text like that in <p> and <h> tags.
<body>
<div style="position: absolute;visibility:hidden">
<h1>Pet Monkey Care</h1>
<p<Feeding pet monkeys can be</p>
<h2>Feeding Pet Monkeys</h2>
<p>Monkey care can be>
<h1>Pet Monkey Problems</h1>
<p>Pet monkeys can cause all sorts of problems</p>
</div>
What we've done is just make an invisible "mini-page" that's full of keywords in different orders. Make sure to mix up the order of your keywords each and every time you use them. Otherwise, the search engine may see through what you're doing and scrap your site.
You'll also want to keep an eye on the density of individual keywords here. "Density" means the percentage of keywords used to non-keywords used. The example above is a little too dense. I did this to get the idea across. You would probably only want to use 5-12 keywords mixed in with an equal amount of other text.
Remember that your viewers will not see this text on your page. It's there to catch the eye of search engines only. Some folks will tell you this doesn't work because the search engines won't read "hidden" boxes.
That's bull. If the search engines ignored hidden boxes, then they couldn't get links out of pop up menus and their spiders wouldn't work on sites using that common effect. It works.
Finally, remember to put your hidden box right after the <body> tag. Spiders ignore everything in the <head> of a page except some <meta> tags and the page's <title>. After that, it's straight to the <body> tag to search for "real" content. Make sure they meet your invisible box first thing when they get to the <body>.
Other Hidden Text
STEP 11 -- You can use the "visibility: hidden" styling to conceal <p>s and <h>s as needed. A reason you might want to do this is to spread your keywords around a bit. Add something like this in the middle and toward the bottom of your page:
<p style="visibility: hidden">
I just love monkey care, feeding monkeys, and pet monkeys.</p>
Again, this is invisible to your viewers, but not to a spider. Notice that you don't have to use the "position: absolute" like you did in the <div> tag.
Spiders used to look only at the top of the <body>, but they've become more sophisticated. They now sample headers throughout the whole page and paragraphs from the first to last. Hidden paragraphs and headers increase the keyword density of your page and makes it more relevant (for queries using those keywords) in the eyes of the search engine.
The ALT Attribute
Search engines are always trying to find some relevant text that can give them a clue to the real content of your site. They particularly like things that you are not apt to manipulate in order to trick the engine. The ALT attribute is one of the items better search engines have begun to scan.
STEP 12 -- The two places that your apt to use ALT tags and that spiders search are in <img> and <a> tags. Put a list of 3-5 keywords in each of these tags' ALT attribute. If you don't use the ALT attribute, start.
Remember to mix up the keywords so it doesn't look like your just copying your list all over the place. This is why a long keyword list is nice. Don't ever use the same order of keywords twice and never let the density of keywords exceed 50% in a section of code.
Comments
Search engines used to give some priority to HTML <!-- comment --> tags. The logic was that the coder would make comments directly relative to the content he was commenting on.
Well, like most things, this was abused and search engines don't give comments any priority any more. The only reason I mention them is because there's a bad search engine tactic that's commonly spread around the web development community.
The rumor says that search engines no longer read <meta> tags so put your site description and keywords in <!-- comment --> tags in your <head> and <body>. This might have been good advice at one time, but it doesn't carry any weight with the major search engines today. It doesn't hurt to add "loaded" comment tags, however, and some search engines might read them.
One warning, though. Don't let these comments increase your keyword density above 50% of the surrounding code.
Other Factors
Now that you know how to create and deploy a good keyword list, there's some other factors you need to know about.
First is keyword density. We've been talking about this a little bit. Basically, don't go crazy with the hidden text and such. If a search engine sees nothing but keywords, it assumes you're trying to trick it and may scrap your page. A keyword density of around 50% is tolerable. So don't code a hidden paragraph of keywords for every regular paragraph you code.
Secondly, submit your site manually to the big search engines. They block the automated systems and the businesses that use them. You might try automated submission for the smaller engines, but don't expect this to fly with the big boys.
Thirdly, age matters. A site with equivalent relevance to yours will be place ahead of yours if it was spidered first. There's nothing you can do about this except to try to increase your relevance and hope the other site goes away.
There are some "web gurus" out there that will tell you all sorts of convoluted methods to "date" your page. This is just ignorant. The date used by the search engines comes from the date they first spider you, not from anything on your page.
Finally, your relevance to your subject increases as other sites link to you. The idea is that if a lot of pages link to you, you must be a pretty big and relevant site. So, get those reciprocal links! When the pages linking to you are spidered, it adds to the relevance of your page.
Summary
There's no brief way to approach optimizing your pages for search engine placement. The basic approach is to develop a prioritized list of keywords. Next, deploy keywords throughout your page, particularly in your <title>, "hidden" boxes, and ALT attributes.
Use <meta> tags, <title>, and one hidden box (right beneath the <body> tag) for each page on your site. Add the other techniques only on your main page.
Be careful not to put too many keywords in a small area of code. The search engine may see this as trying to trick it and scrap your page. A keyword density of around 50% or less is optimal for most filters. Don't use the exact same hidden box on all of your pages.
|