Digg now has an annoying “diggbar” that remains at the top of a page no matter what link you click that takes you away from digg.  This reminds me of about.com and half the sites that existed in the 1990s.  It’s annoying, unnecessary, and pointless.

Although it’s technically called a toolbar, it’s really a frame, which can be removed following the directions below.  There are two ways to remove the digg bar.

The first, involves javascript.  This tip comes from BloggingTips where they state that framing is, unfortunately, on the rise.

To remove this toolbar you need to use what is called a Frame Breaker. All you need to do is add the following code to the HEAD section of your header template (i.e. before the </head> tag) :

<script type=”text/javascript”>

if (top !== self) top.location.href = self.location.href;

</script>

When you add this to your blog the visitor will still see the Digg Toolbar for a second or so and then it will be removed (So for the visitor to go back to Digg they would have to click the back button twice).

Daring Fireball’s John Gruber is so mad that he’s released his own code so everyone can get rid of the the diggbar.  Since his site is mostly PHP based, his code is as well.

<?php
if (preg_match(‘#http://digg.com/\w{1,8}/*(\?.*)?$#’,
$_SERVER['HTTP_REFERER']) ) {
echo “<p>Special message for Digg users here.</p>”;
exit;
}
?>

If you use Firefox, there’s a handy Greasemonkey script to remove the diggbar.

If you are at Digg, you can also remove it by going to My Profile → Settings → Viewing Preferences and change the “show diggbar” to “never show diggbar for external links.”

  • Share/Bookmark