# Even Font Sizes in the Tag Cloud

> Limits the tag cloud to 30 tags with font sizes between 12 and 18 pixels, so it looks tidy in narrow sidebars.

- Type: PHP
- Runs: Run everywhere
- Category: [Widgets](https://wpide.com/library/category/widgets/)
- Tags: widgets, tag-cloud
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/tag-cloud-font-sizes/

## Code

```php
add_filter( 'widget_tag_cloud_args', function ( $args ) {
    $args['smallest'] = 12;
    $args['largest']  = 18;
    $args['unit']     = 'px';
    $args['number']   = 30;

    return $args;
} );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Even Font Sizes in the Tag Cloud" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
