• Skip to main content
  • Skip to header left navigation
  • Skip to header right navigation
  • Skip to after header navigation
  • Skip to site footer
  • Home
  • Books
All Geek Things and All She Wrote

All Geek Things

Random thoughts of a crowded mind

  • Reviews
  • Xena
  • Blog

General

  • Privacy Policy
  • Contact
  • About

Categories

  • Home
  • Features
  • Reviews
    • Loved you in this
  • TV & films
  • Xena
  • Pop culture
  • Business & marketing
  • Writing
  • Bookish
  • Random thoughts
  • Home
  • Features
  • Reviews
    • Loved you in this
  • TV & films
  • Xena
  • Pop culture
  • Business & marketing
  • Writing
  • Bookish
  • Random thoughts

How to customise your WordPress tag cloud widget

12 June, 2016 by PashaO
Wordress tag cloud
114
SHARES
ShareTweetPinterestBufferWhatsappDiggRedditTumblr

WordPress tag clouds can be used as an alternative navigation for readers to quickly access content of the same topic on your website. The more articles your write with the same tags the bigger those words appear in your tag cloud. For instance, I seem to write a lot about WordPress and Twitter, so those words are quite large in my tag cloud.

But tag clouds can get really messy over time, especially if you or your site admins use several tags for an article and never use those tags again. Lots of tiny words in your tag cloud can look really messy. If you intend to use those tags again it’s a good idea to customise your tag cloud.

Change the font size

By default, the tag cloud displays fonts by point (pt); the smallest being 8pt and the largest being 22pt. You can change the size of the fonts so that all the words are the same size or you can increase the size of the smallest words so that they don’t look so bad. To do this you will need to edit your theme’s functions.php file.




Before editing any theme files always make sure you take a copy and that you have FTP access should anything go wrong.

Go to Appearance > Editor > Functions.php and add this code at the end:

//*Customise tag widget
function custom_tag_cloud_widget($args) {
$args[‘largest’] = 20; //largest tag
$args[‘smallest’] = 16; //smallest tag
$args[‘unit’] = ‘px’; //tag font unit
return $args;
}
add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ );




All you need to do is change the font sizes in this example 20 is the largest and 16 is the smallest.

Limit tags to most popular

A good way around the overuse of tags is to decide on agreed tags and try to avoid tag creep. But if you have several administrators who are tag happy, you can limit the amount of tags shown on your site so that just the popular words are shown. Going back to your functions.php file you just need to add this code:

//*Customise tag widget
function custom_tag_cloud_widget($args) {
$args[‘number’] = 0; //adding a 0 will display all tags
$args[‘largest’] = 18; //largest tag
$args[‘smallest’] = 10; //smallest tag
$args[‘unit’] = ‘px’; //tag font unit
return $args;
}
add_filter( ‘widget_tag_cloud_args’, ‘custom_tag_cloud_widget’ );

By default, WordPress only shows 45 tags but you can increase this by setting $args[‘number’] to 0 (zero). Or you can reduce it to a tidy manageable number like 10 or 20.

Hopefully, now your tag cloud will look less messy and as you write more about the same topics the popular tags will change and grow.

Save

Save

Save

Business and marketing Blogging Wordpress

Reader Interactions

Leave a ReplyCancel reply

Sidebar

analytics text

Jetpack Stats new pricing module: What are your choices?

Unveiling pathways: Strategies for creatives to gain recognition

Spotify

Spotify’s balancing act: Celebrating wrapped success amid workforce reductions

Trending

  • Xena: Warrior Princess - Callisto Episodes
    Xena: Warrior Princess - Callisto Episodes
  • The evolution of musical episodes in television
    The evolution of musical episodes in television
  • Hercules and Xena the Dahak and Hope story
    Hercules and Xena the Dahak and Hope story
  • Cancelled too soon: Surface ‍
    Cancelled too soon: Surface ‍
  • Arrow casts Damien Darhk, Mr Terrific and Anarky for season 4
    Arrow casts Damien Darhk, Mr Terrific and Anarky for season 4
  • Babylon 5 - Grey 17 Is Missing
    Babylon 5 - Grey 17 Is Missing
  •  Babylon 5 star Jerry Doyle has died
     Babylon 5 star Jerry Doyle has died
  • Foundation: The masterpiece continues with Season 3
    Foundation: The masterpiece continues with Season 3

Socials

  • Twitter
  • YouTube

Copyright © 2025 · All Geek Things · All Rights Reserved