Modifying WordPress’s Tag Cloud Widget

Wordpress Tag Cloud WidgetWordPress ships with a Tag Cloud widget built in. Unfortunately, this widget is not customizable from the admin panel. You need to modify one of the systems .php files.

To modify the widget, you need to get into your WordPress installs files using your favorite FTP program , and in the “wp-includes” folder you will see a file called “category-template.php”. This is the file we will be working on, so please make a backup copy of it and store it in a safe place before you start. That way if something goes wrong you can recover quickly and easily by re-uploading the known good file. Once you have a backup tucked away, open up the file in your preferred editor ( I usually just use the Text Editor on Mac, or Notepad on Windows) and look for (or search for) “Display tag cloud”. This is the beginning of the part of the file we need to edit, and you will see by reading the commented out text, that there are a few parameters you can adjust. For this article we will look at the font sizes, and the number of tags that  appear in the cloud.

The default settings are:

'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,

As you can see, the smallest tag size is set to 8 points, the largest is 22 points, and the number of tags in the cloud are the top 45. Feel free to enlarge or shrink your font sizes, and ad or subtract the total number of tags displayed. The font sizes are ok for me, but I did increase the number of tags displayed to 150 for this web site.

Once you have made your changes, replace the category-template.php file on your server with the file you just modified, and when you refresh your browser you will see your changes in place.