How to count your blogroll links

Simply paste the following code where you want the count to be displayed:

<?php
$numlinks = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'");
if (0 < $numlinks) $numlinks = number_format($numlinks);
echo $numlinks;
?>

Thanks to Jeff Starr for this tip!

Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!

How to count your blogroll links

Leave a Reply

Your email address will not be published. Required fields are marked *