Archive for SEO
SEO Friendly Split Testing
February 26th, 2010 • SEO
Tags: canonical, SEO, split testing
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
<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
August 9th, 2009 • SEO, scripting
Tags: addon, Firefox, keyword research, keywords, search, seobook, tool
<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
August 6th, 2009 • SEO, scripting
Tags: Google, jquery, keyword rankings, mysql, php, scraper, scripting, serps, tools
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.
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);
}})
}
});
});
Wordpress SEO Guide (ver 2.8.1)
July 13th, 2009 • 1 comment SEO, Wordpress
Tags: guide, link building, noindex, pagerank, permalinks, robots.txt, SEO, Wordpress
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 withgoes against the "plugin" philosophy of Wordpress - so use at your own riskfollows. 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/$1Note: 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.
Why You Get So Much Chinese Blogspam
February 26th, 2008 • 2 comments SEO
Tags: baidu, china, spam
Baidu.com, which has 60%+ market share of all searches in China doesn't recognize the nofollow attribute that Google invented years back to combat blogspam. Baidu treats every link the same - No relevancy issues, no PageRank, no reason not to run wild with automated link building.