SEO Friendly Split Testing

I've recently been spending most of my time split testing the designs across many of the sites I manage. The question is always raised - how will this effect my seo? Unfortunately website owners aren't allowed to serve up different page versions to search engines than to regular visitors - without risking the wrath of Google. (That is unless you're one of the big brands) This technique is commonly referred to as "cloaking" and is expressly in violation of Google's webmaster guidelines. Luckily we have a new tool at our disposal to set things straight with some level of reliability - the link canonical tag. According to Google:
If your site has identical or vastly similar content that's accessible through multiple URLs, this format provides you with more control over the URL returned in search results. It also helps to make sure that properties such as link popularity are consolidated to your preferred version.
Let's assume three split test variant pages:
  • index.php
  • indexb.php
  • indexc.php
To properly point each page to the original you would simply place this tag in the HEAD statement of each page:
<link rel="canonical" href="http://www.domain.com/index.php">
What about other search engines you say? Well luckily Yahoo! and Bing announced support for the link canonical tag at the same time as Google. YMMV with these second-tier search engines - but at least they have stated their intent to honor it. A second level of protection can be added by adding a meta tag to each page to prevent indexation. I would recommend a setting of NOINDEX, FOLLOW as seen below:
<meta name="robots" content="NOINDEX, FOLLOW" >
Obviously this method is ONLY going to work if you are split testing and not multivariate testing.

Firefox Keyword Research Addon

If you are anything like me you probably use seobook's keyword rankings tool enough to have it on speed dial. Luckily the script used to process results accepts a GET request. As a result I have made a simple firefox search engine addon to make it easier to get the keyword research you are looking for. NOTE: I am not in any way affiliated with seobook or Aaron Wall. (Aaron if you'd like me to take this down send me a note - Ryan) xml for search engine:
<OpenSearchDescription>
<ShortName>seobook keyword research</ShortName>
<Description>seobook keyword research
</Description>
<Image height="16" width="16" type="image/x-icon">http://seobook.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://tools.seobook.com/keyword-tools/seobook/?Keyword={searchTerms}"/>
</OpenSearchDescription>
To install this script just click the down arrow on your search engine bar in firefox and select "seobook keyword research". Big thanks to Aaron Wall for creating such a useful tool.

PHP & MySQL Keyword Rankings Script

I've been working on a Google keyword rankings script that scrapes Google search engine results pages and stores the values in a mysql database. The bulk of the heavy lifting is done via php & cURL. I used some jquery to allow manual updating of rankings. Much of the scraper code was lifted from an old 5ubliminal post that I can't seem to find anymore. The following video is a short clip of a portion of the script in action. You can test out the script here.



download


rank.zip

Files

  • connect.php - stores credentials for mysql connection
  • add-domains.php - allows you to add a domain into the database. This domain is then presented as an option on the index page.
  • add-keywords.php - checks a domain (already inserted via add-domains.php) against a keyword. If a match is found it inserts the data into the database.
  • index.php - displays all of your domains
  • final.php - the actual keyword rankings page. Allows you to update rankings and see each domain's keyword rankings on one page.
  • style.css - some css styling
  • postjax2.php - processes serp results and stores values in the db
  • keyword_rankings.sql - database scheme - load this query via phpmyadmin to setup your mysql db
  • header.php - some navigation
  • ajaxproxy.php - some cross domain proxy I found to allow you to get rankings from multiple ip addresses

Google doesn't particularly like it's serps scraped - sometimes they will return garbage data if they suspect you are doing it. To get around this, we must bounce our requests off of multiple IP addresses. If you have a few cheap hosting accounts lying around, upload the postajax.php script to a folder accessible from the webserver. Insert your urls where these files can be found into the following section of code:

  
   var csurla = 'http://YOUR_URL_HERE/postjax2.php';
   var csurlb = 'http://YOUR_URL_HERE/postjax2.php';
   function cointoss(wot){
         var d= new Date().getSeconds();
         wot=(wot)? wot: [csurla, csurlb];
         d+= Math.round(Math.random()*10);
         return wot[d%2];
         }

The above example randomly chooses one of two urls to post the data to. This code could easily be changed to accommodate as many urls as you have access to. The next segment of script gathers the data from each table cell in a row of data. We then serialize the data and post it to to our ajax proxy which gets around the pesky cross domain ajax restriction. the $.Ajax command that is built in to jQuery then waits for the php proxy script to respond and then inserts the resulting data into the row we just clicked:

$(".update").click(function() {
       /* extract all the info out of the table cells */
       var selectR = $(this);
       var urlsearch = $(".urlse a").html();
       var se = $(selectR).find("td.se").html();
       var wt = $(selectR).find("td.wt").html();
       var str = $(selectR).find("td.keywords a").html();
       var ranking = $(selectR).find("td.rankingspan").html();
       var orank = $(selectR).find("td.orank").html();
       var delta = $(selectR).find("td.hclass div").html();
       var clicks = $('#tabler').find("td.clickstotal").html();
       var wttotal = $('#tabler').find("td.wttotal").html();
       var keysearch = str.replace('/%20', '+');
       var csurl = cointoss();
       var dataString = 'csurl=' + csurl + '&clicks=' + clicks + '&wttotal=' + wttotal + '&domain=' + urlsearch + '&keyword=' + keysearch + '&wt=' + wt + '&se=' + se + '&rank=' + ranking + '&orank=' + orank + '&delta=' + delta;
       $(this).html("<td colspan='9' align='center'><img src='http://PATH_TO/loading.gif'></td>");

          $.ajax({
          type: "POST",
          url: "http://PATH_TO/ajaxproxy.php",
          data: dataString,
          cache: false,
          success: function(data){
          $(selectR).html(data);
          var totalr = 0;
          var tempint = 0;
          $("td.clicks").each(function(){
          if($(this).text().length > 0){
           var tempint = parseFloat($(this).text()); 
           totalr += tempint;
           }})
          $("#clickstotal").html(totalr);

       $("td.wt").each(function(){
       if($(this).text().length > 0){
           var tempwt = parseFloat($(this).text()); //convert to number
           totalwt += tempwt;
           totalwt = totalwt.toFixed(2);
           }})
          }
          });
      });

Only An Idiot Would Take Up Nate Silver’s Bet

Yesterday left leaning blogger Nate Silver issued a bet to global warming climate change skeptics in response to John Hinderaker's post about the unseasonably cool summer much of the country is experiencing. Silver states:
Therefore, because I'd like to see more accountability on all sides of this debate and because I'm tired of people who don't understand statistics and because I'd like to make some money, I issue the following challenge.
Hello? Illegal gambling? Silver is undaunted:
For each day that the high temperature in your hometown is at least 1 degree Fahrenheit above average, as listed by Weather Underground, you owe me $25. For each day that it is at least 1 degree Fahrenheit below average, I owe you $25.
So on one hand Silver is upset because climate skeptics (according to him) don't understand statistics and the concept of anecdotal evidence - and then proceeds to make a bet over short term temperatures - the exact anecdotal evidence he is railing about. Regardless of the outcome you can be sure of one thing: This bet will not dissuade true believers, who will brush it off as anecdotal evidence if they lose and claim an urgent need to act if they win. You can not bet against a group of people who move the goalposts (global warming->climate change) when data doesn't conform to their belief system. As a result you would have to be an idiot to bet Nate Silver. UPDATE - Its worth mentioning that the average temperature over the date range Silver provided (June 21-July 18) is 70.5 ° F while historically it is 71.96 ° F according to data from weather.com.

Wordpress SEO Guide (ver 2.8.1)

I recently revisited this blog to make some SEO improvements. I've made a few structural changes to improve my site's indexing that I'm happy to share. Wordpress does a great job of building internal links and with a few tweaks you can squeeze those last precious drops of link juice out. While reading this please keep in mind that you probably shouldn't make any of these changes to a live site, but if you do, disable any sitemap generation plugins you might have. If you ping Google while making iterative changes to your permalink structure you are bound to end up having Google send visitors to non-existent pages.

  • SEO-Friendly URLs

    Many Wordpress blogs use date based permalinks (e.g. /2009/07/11/blog-title/), mainly because it's the most seo-friendly option of the defaults available. However, using categories adds more relevant keywords to each url and removes a duplicate navigation entry point. As a result, I use the category/post title format. To set up these slightly more seo-friendly urls you must login to the admin screen, navigate to settings->permalinks and enter in the following custom values:
    /%category%/%postname%/
  • 301 Redirect Your Old URLs

    On an existing blog like this one, you don't want to lose any back links pointing to your blog posts. In order to do this you will need to create 301 redirects from the old URLs to the new ones. A 301 redirect is a server code that gets sent to your browser informing it (transparently) that the content you were seeking is now permanently moved to a new location. The browser then automatically retrieves the new url without any input from the user. Googlebot also follows these server codes and will credit the new url specified with the back links pointed to the previous url. Setting up these redirects is typically done (on Apache servers) via a module called mod rewrite. Apache uses a special file named .htaccess to manage redirects. You can specify each redirect by hand in your .htaccess file (which could take forever on a large blog), programmatically via regex, or you can just download Dean Lee's Permalinks Migration Plugin which does the trick without requiring you to learn mod rewrite syntax. Just install the plugin in your admin interface, specify both your old and new permalink structures and you are in the clear. It is always smart to make sure a 301 server code is being sent with the location of the new URL. If you use firefox, you can do this easily using the live http headers addon. When done successfully your server will send a code looking like this:
    HTTP/1.x 301 Moved Permanently
    Date: Mon, 13 Jul 2009 17:22:49 GMT
    Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
    X-Powered-By: PHP/4.4.7
    X-Pingback: http://ryanunderdown.com/xmlrpc.php
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0
    Pragma: no-cache
    Last-Modified: Mon, 13 Jul 2009 17:22:49 GMT
    Location: http://ryanunderdown.com/digg/
    Content-Length: 0
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8
  • Remove "Category" Slug from URLs

    I feel the "category" slug that Wordpress adds to category page urls is one of the ugliest elements of the wordpress setup. It makes your urls inconsistent from an information retrieval standpoint. If your posts are structured "/category/post-title/" it makes sense for your category listings to be in the "/category/" folder. Unfortunately fixing it is a little difficult. After scouring the Wordpress forums the best solution I've come up with goes against the "plugin" philosophy of Wordpress - so use at your own risk follows. You will need to download and install the Top Level Categories Plugin. This plugin takes care of removing the category slug on category pages. Next you must redirect your existing category page urls to the new slug-free ones by editing your .htaccess in your blog's root directory. Mine looks something like this:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RedirectMatch 301 ^/category/(.+)$ http://ryanunderdown.com/$1
    
    Note: if your category base uses a something other than category (ie: topics) you will need to adjust the above settings to match. Now the changes above work great except for on paginated categories (e.g. http://ryanunderdown.com/seo/page/2/). To work around this issue you need to update your permalink structure yet again. Go to "Settings->Permalinks" and set your custom URL structure to the following:
    /%category%/%postname%.php
    (while researching this post I was tempted to copy seoegghead's use of the .seo extension for pages: http://www.seoegghead.com/software/wordpress-seo-pager.seo - interesting idea)
  • Install Joost de Valk's Robots Meta Plugin

    This is one of the more useful SEO plugins out there. It allows you to lock down the way your site gets spidered by adding noindex meta tags to dynamically generated pages like "/wp-login". These are the settings I like:
    • noindex comments rss
    • noindex,follow search result pages
    • noindex admin pages (login & register)
    • subpages of the homepage
    • disable author archives
    • noindex your tags archives
    • add noarchive, noodp and noydir tags
    • disable author archives
    • disable date based archives
    • redirect search results when referrer is external
  • Create A Sitemap

    Download the Google Sitemap Generator plugin. This tool gives you options as to what to specifically show Google. Make sure you uncheck "include archives". We want Googlebot to spider our site through our categories. You want to avoid links to the archives in general if you can help it.
  • Fix Your Titles

    Wordpress likes to put your blog name first in post titles by default. To fix this mix up install the All-In-One SEO Pack plugin This little plugin switches up the order and gets rid of the annoying little » symbols wordpress inserts. In addition it gives you a few "per post" options - overall a decent tool.
  • Deep Link Your Existing Content

    If you've ever read the online edition of the New York Times you certainly have noticed how they link back to their own articles about newsworthy items, events, and people. There's good reason for this: links (and especially anchor text) are the currency of rankings. If you are linking to an article on your blog about seo, make sure to use the anchor text "seo" not vague useless keywords like "click here". I know of at least two three plugins that will automatically link up keywords to existing content: SEO Smart Links, Batch Links and (probably the best in the group) Gab Goldenberg's Internal Link Building. These plugins basically require you to create a list of keyword and target url pairs. When a keyword is found in a subsequent blog post it is automagically linked to the appropriate target url (keyword landing page).
  • Disable Comment Links

    Just as inbound links increase your PageRank, outbound links drain it away - even if nofollowed. With the changes to the nofollow tag that have rendered it beyond useless, comment link droppers can put a hurt on your site's link juice in a hurry. Hobo has a nice plugin that disables comment links for new posters.

« Older Entries

Categories