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

I’m a web developer and the founder of XeCreators, an award-winning digital solutions company established in 2013. With over 9 years of experience, I specialize in building custom WordPress-based systems, including POS solutions, hospital management systems, and API integrations. My focus is on creating scalable and practical solutions that help businesses grow efficiently.

Leave a Reply

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

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.