Archive for the ‘SEO’ Category

How To Hide Links To Avoid NoFollow PageRank Sculpting Issues

Saturday, June 6th, 2009

Just recently Google’s Matt Cutts announced a change in how Google handles NoFollow attributes in links thus making a “rel=nofollow” useless on your JavaScript-enabled onClick event handlers. The best method in this case would be to hide links on your page that you would normally have used “nofollow” on so you could only show them via JavaScript.

Instead of using “rel=nofollow” on your links as you did previously you may want to hide the links completely and only make them appear when JavaScript is enabled. You should also show a user which does not have JavaScript enabled that there is a link but it is not enabled. So I decided to create a small JavaScript which converts <span> elements with a specific class name to links when the user has JavaScript enabled. If there is no Ja

vaScript the “links” will look like this:
followlink_1

If JavaScript is enabled and the page has finished loading the links will look like this:
followlink_2

This is the HTML code for the <span> tag which will be converted into a link which needs to be given as the title attribute of the element:

1
<span class="hiddenJSLink" title="http://www.saschakimmel.com/">Hidden Link</span>

This is how the link will look after the script has been executed:

1
<a href="http://www.saschakimmel.com/">Hidden Link</a>

You can also add both an id and additional classes to the source <span> – they will be copied to the final link.

The script requires the prototype.js JavaScript framework – I am using this because I know that many websites are already using it on their pages.

This is some code of an example HTML page – you can download it and the JavaScript file in a package below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>Hidden Links</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="hiddenLinks.css" type="text/css" />
<script type="text/javascript" src="prototype-1.6.0.3.js"></script>
<script type="text/javascript" src="hiddenLinks.js"></script>
</head>
<body>
<ul>
<li><a href="http://www.saschakimmel.com/">Normal Link</a></li>
<li><span class="hiddenJSLink" title="http://www.saschakimmel.com/">Hidden Link</span></li>
</ul>
</body>
</html>

So in essence the only thing you need to do is to add these three lines of code to the <head> section of your HTML file after you have downloaded the JavaScript/HTML/CSS package below:

1
2
3
<link rel="stylesheet" href="hiddenLinks.css" type="text/css" />
<script type="text/javascript" src="prototype-1.6.0.3.js"></script>
<script type="text/javascript" src="hiddenLinks.js"></script>

Acessibility Notice!

Please note that from an accessibility standpoint using JavaScript is not recommended as it renders the links useless on screen readers. But currently there seems to be no other way to hide links from Google for legitimate PageRank sculpting.

License

Creative Commons License
This code by Sascha Kimmel is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. This means that if you are using it on your site (personal and commercial sites are ok) you need to add a link somewhere (only on one page)  as provided here:

1
HiddenLinksJS by <a href="http://www.saschakimmel.com/" target="_blank">Sascha Kimmel</a>

If you don’t want to add a link to your site you can donate any amount to my PayPal account which will entitle you to use the HiddenLinkJS on any page without any requirement for adding a link:


View hiddenLinks.js
View hiddenLinks.css
View hiddenLinks.html demo page

dlnow

How To Use The Bing Webmaster Tools To Get Info On Your Site

Monday, June 1st, 2009

Just today bing.com, Microsoft’s new search engine, has launched. Surely you have already checked out the search results and checked positions of your favorite keywords. But have you also checked out all the tools Microsoft now offers webmasters to analyze their websites?

Verify Ownership Of Your Website

Just go to the Bing Webmaster Center and click on the “Add a site” button to add your website. In the form that is shown enter the URL of the website you wish to add. Bing even allows you to provide an email address ” to contact you if [they] encounter specific issues with your site” which sounds very interesting because Google does not provide that feature. Only the following weeks and months will show what the result of using that email feature will be.

bing-scr01

After submitting the form you have to add some verification code to your site (or your server). In contrast to Google which only requires you to create an empty file with a specific name Microsoft wants you to add an XML file to your server which a specific content. You can also choose to add a META tag to your site but I recommend using the XML file because it’s much simpler – you only need to upload it once to your server whereas you’d have to add the META information to the homepage template.

bing-scr02

After you have added the META tag to your homepage or uploaded the XML file click on the “Return to list” button. You’ll see your website in the list. Just click on the domain name.

Bing will access your website immediately and check for both the META tag or the XML file. If you have done everything correctly you will be taken to the site summary page which provides a wealth of information on your site as seen by Bing.

bing-scr03

Site Summary And Domain Score

The site summary shows you when your site was last crawled by the Bing crawler, the number of indexed pages, whether Bing has been blocked from accessing your site (if you have blocked it via the robots.txt file for example) and a domain score which is shown as five boxes. Microsoft writes here:

“Domain Score provides a measurement of how authoritative Bing views your domain to be, with five green boxes being the highest rating and five empty boxes being the lowest. This is based on many of the same factors Bing uses to determine static rank, but isn’t directly comparable.”

Luckily this blog has a domain score of 5/5 at the time of writing.

Bing also shows you the top 5 pages of your site.

Your Profile

When selecting “Profile” from the top navigation you can change the settings you have already seen when you added your site. You can also see the current verification method Bing is using to verify your site ownership.

Crawl Issues

This section shows you crawling issues that may have occurred on your site such as pages that Bing could not find (404 error) or pages blocked by the robots.txt file.

It also shows you a list of long dynamic URLs Bing has flagged because they think it might lead the crawler into an infinite loop trying to crawl the dynamic URLs and may also lead to duplicate content.

The Crawl Issues page also tells you whether the crawler found pages on your site which it believes to be infected with malware or using unsupported content types.

bing-scr05

Backlinks

The backlinks page shows you all of the backlinks Bing has found to your domain together with the page score, language and region of the page linking to your content. I really like the inclusion of the page score because it may be used to find “bad neighborhoods” linking to your site although Microsoft says that the score isn’t directly comparable.

The page will only show the first 20 backlinks but you can download the complete list as a CSV file to your system.

bing-scr04

Outbound Links

This page will show you all of the links on your site Bing has found that are leading to other websites. Just like on the backlinks page it shows you the page score, language and region as well and even allows you to show your outbound links to malware sites – let’s hope you don’t have any on your site.

Just like before you can also download the complete list as a CSV file.

Interestingly all of the links on my page leading to Twitter (the source of which is a Twitter plugin for WordPress which shows the latest tweets on my blog) have a page score of 5/5. Does that mean that Bing sees Twitter as an authoritative site?

bing-scr06

Keywords

This page allows you to see “how your site performs in search results for searches using specific keywords” although I don’t quite understand the results. You can enter a keyword in the text field provided and it will show you the page on your site, the page score of that page and once again the language, region, last crawl date and whether the Bing crawler was prevented from accessing the page.

bing-scr07

It is interesting but I had expected to see SERP positions for the given keyword which would be a great feature. Entering “wolframalpha” shows a page score of 5 for my article on WolframAlpha yet when searching for “wolframalpha” on bing.com that page is not listed in the first 100 results.

More (Not So) Interesting Stuff

You can also add your sitemap directly by clicking on the Sitemaps tab.

The “Related Tools” section in the navigation on the left side lists some links that sound interesting at first but in my opinion they are a bit disappointing. If you thought that by clicking on the Robots.txt validator link you would be able to analyze the robots.txt file for your current site you’re wrong. You can copy the contents of any robots.txt file there to check it for incompatibilites with the MSNBot but that’s all. Slightly disappointing.

Likewise the HTTP Verifier and Keyword Research Tool links lead you directly to the default pages on the Microsoft website.

Bottom Line…

I recommend that you add your site(s) to the Bing Webmaster Center so that you can access the interesting statistics they provide – I’m sure many more tools will be provided in the future.

You should also check out the forum for many interesting discussions.

I’m amazed that Microsoft provides these features just from the launch day on.

We’ll see what else will be provided in the future.

Saving Link Juice With Nofollow For The “Twitter for WordPress” Plugin

Wednesday, May 20th, 2009

I have just recently enabled the Firefox Addon SearchStatus while on my blog’s homepage. I was amazed that the Twitter For WordPress plugin doesn’t add rel=”nofollow” to the My Latest Tweets widget (see on the right in the sidebar).

Therefore I have just added the corresponding code to the plugin’s PHP file and thought I should share this information because it might really be useful for other people.

Adding rel=”nofollow” to the Twitter links

First make a backup of the file wp-content/plugins/twitter-for-wordpress/twitter.php and save it as twitter.org.php in the same directory. Afterwards open the file twitter.php and modify the code as highlighted here. You need to scroll to the right to see the highlighted code:

function hyperlinks($text) {
    // match protocol://address/path/file.extension?some=variable&another=asf%
    $text = preg_replace("/\s([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)([\s|\.|\,])/i"," <a rel=\"nofollow\" href=\"$1\" class=\"twitter-link\">$1</a>$2", $text);
    // match www.something.domain/path/file.extension?some=variable&another=asf%
    $text = preg_replace("/\s(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)([\s|\.|\,])/i"," <a rel=\"nofollow\" href=\"http://$1\" class=\"twitter-link\">$1</a>$2", $text);
    // match name@address
    $text = preg_replace("/\s([a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]*\@[a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]{2,6})([\s|\.|\,])/i"," <a rel=\"nofollow\" href=\"mailto://$1\" class=\"twitter-link\">$1</a>$2", $text);
    return $text;
}

function twitter_users($text) {
       $text = preg_replace('/([\.|\,|\:|\¡|\¿|\>|\{|\(]?)@{1}(\w*)([\.|\,|\:|\!|\?|\>|\}|\)]?)\s/i', "$1<a rel=\"nofollow\" href=\"http://twitter.com/$2\" class=\"twitter-user\">@$2</a>$3 ", $text);
       return $text;
}

After you have added the code save the file, upload it you your server and you’re done.

If you are using the WP Super Cache plugin be sure to empty the cache so that all pages are updated.

tweetthis-15

How To Create Search Engine Friendly RewriteRules For Domains

Tuesday, May 19th, 2009

Do you have multiple domains pointing to your website? From an SEO standpoint you shouldn’t have them all pointing to your document root directory because this might be interpreted as duplicate content by the search engines or you might even get a mixup of pages distributed over several domains and subdomains (like example.com and www.example.com) in the organic search results.

If you are using Apache and have access to the RewriteModule you should configure the VirtualHost like this so that all domains and subdomains are redirected to the main hostname via a search engine friendly HTTP 301 redirect:

<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot /srv/www/example.com/htdocs
ServerName www.example.com
ServerAlias example.com
ServerAlias www.example.org
ServerAlias example.org
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com$1 [L,R=301]
…
</VirtualHost>

This will redirect all requests not going directly to http://www.example.com to that hostname. So even if someone enters http://example.org/index.php the server will issue a redirect to http://www.example.com/index.php.

Of course this also works if someone links to your page with a link like http://example.com/file.gif. In that case the redirect will be issued to http://www.example.com/file.gif. Google likes that.

tweetthis-15

Why WolframAlpha Should Hire An SEO

Sunday, May 17th, 2009

Although my first look at WolframAlpha was rather disappointing I didn’t really intend to show everything that’s not working as I had expected. However I stumbled upon problem after problem.

Now I didn’t intend to write this article at all but just searching for what Google has already indexed of WolframAlpha and following some links made it clear that they obviously didn’t think about SEO at all prior to launching their site.

The problem is: they are doing many things that  might actually harm their Google rankings that are just beginning to show up. We don’t yet know who will be using WolframAlpha in two months, if it will grow to become something that most of the people will use  just like Google or if it is going to fail like WikiaSearch.

Remember: they received over 1000 links to their site within two days and this is likely to grow so it makes sense to optimize the site now to prevent damage.

So from a logical point of view if I had been responsible for the WolframAlpha website I would not have done any of the following that WolframAlpha has implemented:

  • You Should Prevent No-Result Pages From Being Indexed
    “no result” pages return an 200 HTTP status code, not a 404 – Google will likely index these pages. The page doesn’t contain any META robots tag containing “noindex,follow” either.
    Because the differences between different “no result” pages depending on the query are only marginal this might be seen as duplicate content which you should never have on your own site.
  • Don’t Use Redirects For Loadbalacing
    Using the search field on the homepage now redirects via a 302 redirect to a hostname like “www18.wolframalpha.com” leading to even more duplicate content if Google indexes the same page with two different hostnames, e.g. www18 and www76. Normally you would be using a loadbalancer and not use HTTP redirects to distribute the load. They should at least be using the canonical tag to tell Google the original URL, but they aren’t, regretfully.
  • Use A Robots.txt File
    WolframAlpha is currently not using a robots.txt file so they are not telling search engines what should not be indexed.
  • Optimize The Clickthrough Rate In The SERPS
    The result pages do not contain a META description field which I would recommend for a higher click-through rate in the organic search results.
  • Use Text To Display Text, Not Images
    The title tag could also be optimized but I still don’t understand why even simple text is rendered as an image.

What do you think?

tweetthis-15

Must-Have Firefox Addons For The Developer

Monday, April 20th, 2009

Here is a list of Firefox addons for every web developer most of which I’m using almost daily. I can highly recommend any of these addons and I’ve been using most of them for a very long time.

Firebug

Nowadays I think I could just ask where you’ve been living for the past two years if you don’t know this must-have extension. Firebug allows you to debug your JavaScript code on your live website, to view and edit the HTML code and  CSS files on-the-fly directly for the current page and much much more.

Firebug also features am essential JavaScript console you can use in your own scripts for debugging and logging. Just check it out – it’s so essential that I won’t get into any more details here.

JSView

This cool addon adds a “JS/CSS” button to your browser’s status bar allowing you to see and view every single CSS and JS file that’s loaded on the current page. Sure – Firebug has the same feature, but using JSView actually makes this even easier than Firebug.

QuickJava

Quite often you have to check your own website to see if most of it still works if the user has JavaScript disabled. This addon adds to small buttons to your status bar which allow you to enable and disable both Java and JavaScript in your browser with one click. You still need to reload the page but this saves you from the tedious task of opening your browser settings each and every time you need to turn it off (or on).

HTML Validator

You should always make sure that your website contains only valid (X)HTML code and there is no easier way than installing this addon. This one also adds an icon to the status bar of your Firefox browser which is either a yellow warning sign, a green “ok” image or a red icon with a white cross indicating the validity of the code on the current website.

By double-clicking on that icon you are taken immediately to the source code view of the page including all of the warnings and errors that this addon has found in your code. Best of all – it checks everything offline, so it’s not sent to the W3C Validator and it’s very fast.

Live HTTP Headers

Sometimes you need to check the HTTP headers sent by your browser to the server or vice versa. This addon allows you to do just that and you can even apply regular expressions to the output so that you will only see what you are looking for.

Web Developer (Toolbar)

This is also a must-have addon just like Firefox which adds several features missing from your Firefox if you’re developing websites. Most often I’m using the “Find broken images” feature although this is just a very small part of this mighty tool.

ColorZilla

Sometimes you need (or want) to know the specific hexadecimal color code of a specific color on the website you’re currently on. ColorZilla adds a color picker to your browser and allows you to copy the color values directly to the clipboard so that you could insert it in your CSS file (that is what I am using it for most of the time).  And it still offers even more features that that.

MeasureIt

Draw a ruler to measure the width and height of any object on the current page.

SearchStatus

Would you like to know the current PageRank of the current website or the Alexa rank? This addon also offers additional features such as highlighting “nofollow” links and easy access to WHOIS and robots.txt information for the current domain.

SEOBOOK SEO  Toolbar

This is your ultimate SEO addon as it integrates as a toolbar into your Firefox browser and shows you almost anything of interest regarding SEO on any website. You can directly see the PageRank, Yahoo! backlinks, Yahoo! indexed pages, whether the current site is listed in the Open Directory Project (DMOZ), in the Yahoo! directory and so much more. You can even see the approximate age of the domain according to the first version indexed by the Internet Archive.

If you know any other cool addons for a web developer I would very much appreciate your comments and feedback.

tweetthis-15