If you have a WordPress website with many tags, you have undoubtedly ran into a situation where you notice they are not always all displayed. This happened to me when adding a new tag and I noticed it was not displayed.
Researching this on the Internet revealed a lot of frustration and many being told in posts it cannot be done because WordPress sets the limit at 45.
The https://developer.wordpress.org/reference/functions/wp_tag_cloud/ page yielded sufficient background for me to create a function that I was able to add to my theme’s function file. I highly recommend using a child theme to ensure any added functions are not overwritten on theme updates.
Add a Filter
Here is the filter code that worked for me. I suggest you alter both instances of the charlesworks_com to be something meaningful to you. Also alter and the number (I used 200 below) to whatever you need. Note that when placing the code in my functions.php file, I used a tab character to indent the two lines below under the “function charlesworks_com_tag_cloud_args( $args ) {” line. The code snippet below has leading hard spaces in those lines, so you might want to avoid copying them into your functions.php file:
/* -- Start of CharlesWorks 45 tags override filter --*/ function charlesworks_com_tag_cloud_args( $args ) { $args['number'] = 200; // the number of tags you want to display. return $args; } add_filter( 'widget_tag_cloud_args', 'charlesworks_com_tag_cloud_args' ); /* -- End of CharlesWorks 45 tags override filter --*/
I tried it out and it worked like a charm!