Archive | October, 2008

Tags: , , ,

Hiding Content from Spiders with jQuery

Posted on 19 October 2008 by Ryan

Any decent SEO is certainly aware of the CSS float technique to manipulate how a search engine spider caches your site. The idea behind this trick is that if the main content of any page is cached before less important, less relevant content, it will slightly improve your keyword rankings. This SEO technique never really made enough difference for me to get excited about it (maybe that’s just the link builder in me talking), but below is an example of how it works.

Floating Divs for SEO

<html>
   <head>
      <style>
      #container {width:400;}
      #right {width:200;float:right;}
      #left {width:200;float:left;}
      </style>
   </head>
<body>
     <div id="container">
          <div id="right">
               Content we want to highlight
          </div>
          <div id="left">
               Content we want to bury
          </div>
     </div>
</body>
</html>

JavaScript Templating

However I recently came across a few javascripts for including files on the client side instead of the traditional server side with php, asp, python etc. Of course I was familiar with the innerHtml function, but never considered the value of using a JavaScript templating system to prevent undesirable portions of a website from being indexed. This little script (4 lines of code) could, in theory, be an additional site sculpting tool to limit spider-ability much in the same way as the “nofollow” tag is used to sculpt PageRank.

How it Works

jQuery does the bulk of the heavy lifting and we will borrow Levi Senft’s jsinclude script (or write your own). Like most JavaScripts, it must be called onload, grabs the file name and path for the file to be included. The content specified between the elements tags is then appended to the dom element in question. the jsinclude file appends to any div with the class of “jsinclude”, but in practice you could set that to whatever naming convention you want. The content is displayed slightly after the original page is cached by the spider, letting us “cloak” our content without fear of reprisal from Google. We will show the exact same content to a normal visitor and a spider, we will just use the spiders shoddy JavaScript support and inherent need to cache pages quickly against it.

How To Implement

First off the bat we need to download a fresh version of jQuery, and add it to the HEAD section of your page’s html, making sure the path points properly.

<head>
    <script src="jquery-1.2.6.min.js" type="text/javascript"></script>

</head>

Then we want to call the jsinclude file right after our analytics urchin and before the end closing tag.

<script type="text/javascript">
     var pageTracker = _gat._getTracker("UA-583901-5");
     pageTracker._trackPageview();
</script>
<script type="text/javascript">
      function jsinclude_init() {
	$('div.jsinclude').each(
		function () {
			$('#'+this.id).load(this.innerHTML);
		}
	);
}
</script>
</body>

Now to apply the proper style to the divs we want to hide, and list the path of the file to include:


    <div id="nocache" class="jsinclude">/path/to/file.html</div>

That’s it. The downside is you have to physically wrap the html-php-etc you want to include in a div, but other than that you now have a JavaScript templating engine that works even on web hosting that doesn’t support php.

Comments (3)

Tags: ,

Url Shorteners – What’s in it for an SEO ?

Posted on 12 October 2008 by Sergiu

A lot of people recently discovered URL shorteners and like any successful idea tons of sites appeared over the night, sites that try to get a piece of the pie offering this service in different flavours.

Why would anyone need a URL Shortener?

Well there are some situations where a Url really needs to be shortened. Some sites especially social bookmarking or social media sites have set up limitations when it comes to posting links. And if you have a 3 line link then your only solution is to make it shorter or post it on your blog…

And as the web evolves (2.0 or 3.0 ?) url’s like http://209.85.135.104/search?q=cache:QCVFcgmM_AMJ:answers.yahoo.com/question/index%3Fqid%3D20080812142512AAaF0p6+i+need+some+spelling+help+!&hl=en&ct=clnk&cd=1 seem normal although pretty hard to process.

How would a beginner treat this link ? It might seem funny but some people think this link could contain a virus. How many even heard of a data center ? most will probably think that an address like 209.85.135.104 is some kind of a hack.

The solution is very simple though. Get a site up mix it with a text coding algorithm and you get a brand new url redirecting to your original input. The new “shortened” url will most likely be in the range of 4-6 characters excepting the homepage of course.

For example take this page and the shortened version:

  • http://indexedcontent.com/uncategorized/url-shorteners-whats-in-it-for-a-seo/
  • http://tinyurl.com/5y82j2

Can you spot the difference ? We went from 77 to 25 characters but the result is the same. The best part is that you can customize your new link giving extra information to the visitor by adding your own alias like so:

  • http://tinyurl.com/urlseo

This will have the same effect but it looks better than the first one that’s for sure and it’s 25 characters too ! Tiny url is just an example although one of the most popular URL shorteners that exists but there are literally hundreds of other alternatives out there. Others are appearing as we speak.

A list of some URL shorteners that i’ve come across (the first 4 are the most popular):

  1. http://tinyurl.com
  2. http://www.dwarfurl.com
  3. http://doiop.com
  4. http://memurl.com
  5. http://traceurl.com
  6. http://ix.lt
  7. http://tiny.pl
  8. http://is.gd
  9. http://smarturl.eu
  10. http://www.snipurl.com
  11. http://yweb.com
  12. http://xaddr.com
  13. http://muhlink.org
  14. http://u.mavrev.com
  15. http://bit.ly/go

Ok the presentations are over and we all agree that URL shorteners are a useful way of clothing our ugly url’s and make the Internet a cleaner happier place. But what’s in it for an SEO  then?

Well linking is one of the cornerstones of a SEO so if you take away his linking power then somebody is not happy right ? Although most links today have the nofollow attribute and most social media sites aren’t sending any linkjuice there will be people using these url shorteners for their own sites. This translates into more links to these Sites that shorten URL’s and not the original destination. Although they are still useful as referrals i think that sites will be losing a lot in the SERPs.

Somebody will be busy getting in the goods though and it will be interesting to see how SEO’s will adapt to this growing phenomenon.

I wish i thought of this a way back hehe.

Comments (1)

Blog Advertising - Advertise on blogs with SponsoredReviews.com Advertise Here