Is there a way to add more tags to the tag cloud?

The tag cloud widget uses wp_tag_cloud() to display the tags, which defaults to 45 tags.

Source: https://developer.wordpress.org/reference/functions/wp_tag_cloud/

One can use the widget_tag_cloud_args filter to change this number (and any other arguments passed to wp_tag_cloud(). Here’s an example:

function wpse_235908_tag_cloud_args( $args ) {
    $args['number'] = 70; // the number of tags you want to display.
    return $args;
}
add_filter( 'widget_tag_cloud_args', 'wpse_235908_tag_cloud_args' );

You can add this piece of code in a custom plugin or your theme’s function.php file for example.

Note: There’s also a doc reference for the widget_tag_cloud_args filter, but the documentation is currently wrong as per this core ticket.

Leave a Comment

tech