All-Encompassing Trip, by Guillermo Esteves

How to get rid of the DiggBar on Tumblr

I’ll let someone else explain why the DiggBar sucks, or why it doesn’t, but if you want to block it (and others, like Facebook’s) on your Tumblr blog, simply add this slightly modified frame-busting JavaScript to your theme:

<script type="text/javascript">
if ((top !== self) &&
    (document.referrer != 'http://www.tumblr.com/customize')) {
    top.location.replace(self.location.href);
}
</script>

The second condition of the if is important because without it, the script will break Tumblr’s “customize” page, and you won’t be able to modify your theme again.

This might not help with whatever side effects the DiggBar may cause on your PageRank, but at least it’ll stop your site from looking like this in the future.

Update: If you only want to block the DiggBar, use this instead:

<script type="text/javascript">
if ((top !== self) &&
    (document.referrer.match(/http:\/\/digg.com\/\w{1,8}\/*(\?.*)?/))) {
    top.location.replace(self.location.href);
}
</script>

Another update: Faruk Ateş says that using top.location.replace prevents the Back button from being broken. I updated the code to reflect that.