Limit Your WordPress Tag Cloud To Help Control PageRank Flow

wordpressHave you ever wondered how to limit the number of tags displayed in the sidebar when using the default tag cloud widget in WordPress?

The default tag limit is fairly large; 45 tags in the latest version of WordPress. That can definitely affect your PageRank flow and link-to-text ratio some. A bit more useful on smaller blogs with less PageRank to spread around, however the net affect can still be helpful on high authority blogs.

I don’t actually use post tags on this blog (for no specific reason), but when I was trying to figure it out for another one of my blogs I thought for sure there would be a ton of how-tos on this issue considering Google Suggest displayed limit tag cloud wordpress in the search box as I typed it in. Nevertheless, I didn’t find good information.

I ended up having to figure it out by testing the code myself since I already new where to limit the font-size in the tag cloud, I figured it had to be close. Close it was, actually on the same line of code.

How to Limit the Number of Tags in Your WordPress Tag Cloud

Find this file yourdomain.com/wp-includes/category-template.php and download it to your local machine using ftp or a similar protocol.

Then open it and find this code around line 525:

function wp_tag_cloud( $args = ” ) {
$defaults = array(
‘smallest’ => 8, ‘largest’ => 12, ‘unit’ => ‘pt’, ‘number’ => 45,

Change the 45 to equal the desired number of tags. As of this post I am using the most recent version of WordPress which is WordPress version 2.8.6.

After backing up your live file, just upload the modified category-template.php file back to your web server. Now the desired number of tags should be displayed.

Unfortunately, It appears you have to fix this every time you update WordPress, that is, unless anyone knows of a better way to do it?

Share This Article With Friends!

Free eBook: A Practical Guide to SEO

FREE SEO eBook!

Download your copy of our FREE SEO Guide and also receive valuable blog updates via email.



  • December 8th, 2009 at 4:31 am Hampry said:

    Thanks for the very helpful information about SEO.To day many of website use this WordPress them.Wordpress blog very popular and very use full.The default tag limit is fairly large 45 tags in the latest version of WordPress.

  • February 20th, 2010 at 4:24 am Chaibi Alaa said:

    Hello,

    That was very helpful for me, Thank you a lot :)

  • February 20th, 2010 at 8:26 am Wesley LeFebvre said:

    Anytime, Chaibi!

  • April 2nd, 2010 at 8:34 pm Ibrahim said:

    Thats great… I ate my mind solving the issue cause it was effecting the look of my site but i came to knw it has something to do with SEO as well.. HMnnmn… Useful info. Thanks Chabibi! Keep up the good work

  • April 3rd, 2010 at 12:33 pm Wesley LeFebvre said:

    Hi Ibrahim!
    Yeah, I don’t know why they make the font so big by default. Doesn’t make any sense to me. Anyway, glad to hear this post helped you solve the issue. Also, I took a look at your blog and I really like the theme you used!

    best,

  • April 20th, 2010 at 8:18 pm Robert said:

    Thanks a lot. My tags cloud kept growing and pushing my remaining navigation options too far down the page.

  • April 21st, 2010 at 9:29 am Wesley LeFebvre said:

    Hi Robert! No problem. Yeah, I hate it when that happens.

  • June 1st, 2010 at 4:11 am shaid said:

    On your theme wp_tag_cloud(‘smallest=8&largest=22&number=30′);

    you can change every parameter of tag cloud from here

  • January 24th, 2011 at 9:44 am Anson Alexander said:

    This was EXACTLY what I was looking for! Thanks!

  • February 16th, 2011 at 10:49 pm 2010 said:

    Hiya,

    Yes, thanks for the info. I only recently implemented tags with definite SEO success but also had layout issues. Now I’ve learn’t to many tags isn’t always that good. Cheers for helping a guy with only self taught programing how to sort the issue in what seemed like minutes.

  • February 16th, 2011 at 10:56 pm Wesley LeFebvre said:

    No problem, Jeremy. Glad you were able to get it fixed up!

  • March 13th, 2011 at 3:56 pm Bruce said:

    I wonder what’s a good limit to set?

  • March 14th, 2011 at 8:08 am Wesley LeFebvre said:

    Hi Bruce,
    It really depends on your particular website. In most cases I can’t see any reason to use any more than 10-20, or whatever fits the best on your blog. For my websites I don’t use them at all anymore.

  • March 29th, 2011 at 8:17 am Lauren Williams said:

    Excellent. Thanks for this, was trying to find out which file I could edit this in. Surely there must be an easier way to manage this in WordPress 3+ though?

  • March 29th, 2011 at 9:58 am Wesley LeFebvre said:

    Not that I’m aware of, but I don’t use tags anymore.

  • April 21st, 2011 at 1:00 am Andkon said:

    I already tried it, but in version3.1.1 maybe I need to clear the cache first. Thanks a lot. Nice tutorial!

  • April 21st, 2011 at 1:18 am Andkon said:

    Oh I just clear the cache, my bad… it works.. I made limit it to 20 tags. Does tags really helps? Hope somebody replies.. It means a lot because I’m planning to remove tags. Someone please tell!

  • September 4th, 2011 at 1:05 pm Renji said:

    This did it, but is there any other way to limit tags without editing a core file?

  • February 13th, 2012 at 2:46 am Josselin said:

    It’s better not to change the core files. Instead you should place this in the functions.php file of your theme.

    function my_tagcloud($args){
    $my_args['number'] = 25;
    $args = wp_parse_args( $my_args, $args );
    return $args;
    }
    add_filter(‘widget_tag_cloud_args’,my_tagcloud);

  • February 13th, 2012 at 11:40 am Wesley LeFebvre said:

    Agreed. Thanks for the code Josselin!

  • July 26th, 2012 at 1:09 pm Nilanko Halder said:

    Great neat trick! Thanks!

  • November 6th, 2012 at 9:24 am kshitij jain said:

    thanks for this wonderful info, i successfully decreased the number of tags in cloud. Can you tell me something about keyword stuffing

  • November 6th, 2012 at 12:21 pm Wesley LeFebvre said:

    This isn’t the right page for that topic. However, in short, just don’t do it!

Leave a Reply?

free trial button

Free eBook: A Practical Guide to SEO

Free SEO eBook

subscribe to seo rankings via email Download our FREE SEO Guide and receive valuable blog updates:


subscribe to seorankings.com via rss RSS follow seo rankings on twitter Twitter - more ways to connect and subscribe.