Sometimes you may want to limit the tags in WordPress tag cloud widget because your site have lots of tags. To limit the tags you only need to add the following function to your function.php file.

 

function tag_cloud_limit($args) {

	if ( isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag' ) {
		$args['number'] = 16; // Number of tags to show
	}

	return $args;

}
add_filter('widget_tag_cloud_args', 'tag_cloud_limit');

 

Muhammad Zohaib

Web Developer specializing in WordPress to develop custom themes, plugins, troubleshooting technical issues and ensuring websites are optimized for search engines and meet accessibility standards. Currently working as Lead Developer at XeCreators.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.