How to show limit number of Tags Displayed by WordPress tags cloud

By | Widget | No Comments

The Tag Cloud widget is a useful widget which displays a cloud of your most used tags on the sidebar or other areas that support widgets on websites powered by WordPress. But when the number of tags used grows, the list output by Tag Cloud widget may simply become too long or too short to your liking.

The default Tag Cloud widget does not support limiting or increasing the tags count.

Unfortunately, Tag Cloud widget does not provide any way to customize or set the number of tags to show in the output. To control the number of tags displayed by Tag Cloud widget, insert the following code snippet in your active theme’sfunctions.php custom functions file.


Replace the number of tags to display with your own desired count. Example above shows 25 tags. By default, WordPress limits the terms shown to 45 most used tags. You can increase (add) or decrease (reduce) the number of tags shown as you like.

On the other hand, if you use custom taxonomies and want to display those instead, replace the post_tag (the default WordPress taxonomy for tags) in the above code with the custom taxonomy term.

WordPress Exclude Categories from Recent Posts Widget

By | Widget | No Comments

Today I had to find a way to exclude posts from certain categories from showing up in the recent posts widget. I did a search and I stumbled across this discussion in the WordPress Forums.

I have found that pretty much everything you need with WordPress has been discussed and solved somewhere out in the Interwebs. Thankfully lawless shared his solution to this need. By adding the following code to your functions.php file, you can exclude categories by adding the category ID to the new Exclude Category(s) field.You can copy his code below and paste it into your functions.php file. I also packaged it up as a plugin which you can download and install manually. I will work on adding it to the WordPress repository shortly.





Freelancer Wordpess Developer Team