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

Be Sociable, Share!
  • Twitter
  • Facebook
  • email
  • Google Reader
If you enjoyed this post, make sure you subscribe to my RSS feed!

Tagged with:

Filed under: BloggingInternetMisc Assorted General StuffOpen sourceOpinionProgrammingSite NewsSoftwareTutorials

Like this post? Subscribe to my RSS feed and get loads more!