Modify the WordPress Tag Cloud Widget Easily

There are numerous ways of how to modify the WordPress tag cloud widget, but there’s an easy way to modify it. I searched about how to modify such, and landed on different blogs sharing different methods to modify the widget. I also landed on this page which tells everyone to modify the WordPress core. But I don’t think it’s the best solution to customize your WordPress Tag cloud.

In the same blog post I linked above, one guy also shared his trick in modifying the WordPress tag cloud. He said that modifying the functions.php is the best way. You never need to hack the WordPress core, and it’s a NO NO to modify core files, because when you update your WordPress blog, your modifications will be overwritten. If you’ve read the comment that I linked, you’ll noticed that there are so many unnecessary lines of code in his “trick” to modify WP’s tag cloud widget.

If you don’t want to edit WP core files and you don’t want to copy and paste unnecessary lines of code, then use my method. Just copy paste the code below and paste in your functions.php.

add_filter('widget_tag_cloud_args', my_tag_cloud_args );
function my_tag_cloud_args($in){
return 'smallest=10&largest=20&number=100&orderby=name&unit=px';

Just modify the small integer, largest integer and number of tags to suit your needs. You can also modify the order of your tags if you want it to be by name or by count. The unit can be pt, px, em, or %.

You can also check the WordPress Codex function reference for wp_tag_cloud to know more parameters in the wp_tag_cloud function.

That’s all for today! Thank you for reading!

UPDATE: If you want a Better Tag Cloud, check this out! It’s literally a BETTER tag cloud! Hat tip to Maria for sharing this awesome plugin!

Do you love this article and you want to receive more interesting posts from Bryan Veloso? Why not subscribe to this blog via e-mail? It's easy! Just enter your e-mail address below and confirm your subscription by clicking the activation link that will be sent to your e-mail! Get your free subscription now!

Enter your email address:

This entry was posted in Geekery, Internet and tagged , , , , , , , . Bookmark the permalink.

6 Responses to Modify the WordPress Tag Cloud Widget Easily

  1. Maria says:

    Thanks for the link love!

    Unfortunately, the post you linked to is VERY old. I’ve since switched to a plugin that offers far more flexibility: Better Tag Cloud. You can find it at

    • Bryan Veloso says:

      Hi Maria,

      You’re very much welcome! Wow! Thanks for sharing the Better Tag Cloud! I will include it in this post so that others who are looking for it can easily find it! 🙂

  2. Steve says:

    Just what I needed. Thanks for sharing bryan!

  3. Kristóf says:

    Hi Bryan,

    I tried this method, and work fine with my tag cloud, but it change my category cloud too to tag cloud. Do you know any solution for this problem?

    Thanks for the info!

Leave a Reply

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