Putting Inbound Technorati Links Back On WordPress Dashboard

January 18th, 2008 | Posted in Blogging, Internet, Misc Assorted General Stuff, Open source, Opinion, Programming, Site News, Software, Tutorials | 4 Comments

When wordpress went from version 2.2 to 2.3, one of the changes I noticed was the incoming links are no longer shown from Technorati.  Instead you see the incoming links from a google blogsearch.  I started out doing this because I wasn't all that thrilled about the change and wanted to change back.  Along the way it occurred to me that having both sets of incoming links could make for some useful comparisons.

After grepping around to find where the code is that shows the google links I found it in the wp-admin directory in the file “index-extra.php”.  To make the change I did, first make a copy of that file to something like index-extra-old.php so that you can put the original back just in case it gets messed up.

Next, download and open index-extra.php and locate the code shown here in orange. It will be near the top of the file.:

case 'incominglinks' :

 
$rss_feed = apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
$more_link = apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );

 
$rss = @fetch_rss( $rss_feed );
if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
?>
<h3><?php _e('Incoming Links'); ?> <cite><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('More »'); ?></a></cite></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 10);
foreach ($rss->items as $item ) {
?>
        <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
<?php } ?>
</ul>
<?php
}
break;

Replace that code with the code shown below in green, save the file and upload it back to the server.  (Be sure to upload the edited file to the wp-admin directory and overwrite the old one or it wont work.)


case 'incominglinks' :

$rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
?>
<h3><?php _e('Incoming Technorati Links'); ?> <cite><a href="http://www.technorati.com/search/<?php echo trailingslashit(get_option('home')); ?>?partner=wordpress"><?php _e('More »'); ?></a></cite></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 10);
foreach ($rss->items as $item ) {
?>
        <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
<?php } ?>
<?php
}

$rss_feed = apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
$more_link = apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );

$rss = @fetch_rss( $rss_feed );
if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
?>
</ul><h3><?php _e('Incoming Google Links'); ?> <cite><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('More »'); ?></a></cite></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 10);
foreach ($rss->items as $item ) {
?>
        <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>

<?php } ?>
</ul><br>
<?php
}
break;

Once this code is in place log in to your WordPress dashboard.  The “Latest Activity” section will show “Incoming Technorati Links More »” and a list of links, followed by “Incoming Google Links More »” and another list of links.

Note: any time you upgrade wordpress the index-extra.php file will be overwritten by the new version and you'll have to re-apply this mod.  (unless of course the folks at wordpress.org can be convinced to adopt this mod.)

Technorati Tags: backlinks, google, google+backlinks, google+links, incoming+links, index-extra, latest+activity, technorati,, technorati+backlinks, technorati+links, wordpress, wordpress+mod

If you enjoyed this post, make sure you subscribe to my RSS feed!
Link to this post:
Just copy this code and paste it on your site where you want the link to appear:

4 Responses to “Putting Inbound Technorati Links Back On WordPress Dashboard”


  1. A quick note for anyone trying to apply this patch:

    Before uploading this patch to your server, it is necessary to go through the code pasted from here and fix all the single-quotes. WordPress insists on dressing up quote marks so that 'this' becomes ‘this’. Not much of a difference to you and me, but PHP can’t stand that!

    Other than that one caveat, the patch works great! Thanks!


  2. Thanks for pointing that out.

    I’ve edited the post above and fixed it so that nobody need do any editing of the code.  I then tested ithe by applying it to this blog and it works


  3. ohh..that a very nice tweek..
    Thanks..
    ~Himanshu~


  4. Tip is good but what I like more is those green color php codes on dark background. It remind me of old days of dos. Looks nice!