Seial Entrepreneur

How to display the most popular Tags on the site WordPress



Tags (tags) and Categories (categories) are the two main ways to sort and filter content in WordPress. While Columns are a more important type of content sorting, tags stay in their shadow, and often the authors and editors of the materials on the site are lazy to point them out.

And it’s in vain, because the tags are very good for SEO. With the correct approach to the design of content on WordPress, you should have much more tags on the site than the headings. The number of headings on the site rarely exceeds ten, and to each new post you assign one specific heading. But the labels for each post, as a rule, a few.

Thus, the number of tags on the site can easily exceed the number of posts themselves. And in order not to get lost in this hodgepodge of labels, we’ll show in this lesson how to display the most popular Tags on the WordPress site.


Why show the most popular Tags on WordPress?

As we have said, the headings cover broader and more general topics. Find a specific material on the site, knowing only its heading, will be much more difficult.

But tags are assigned to a more specific idea or context in the record. And if you see a list of all the tags on the site, the probability of quickly finding the material of interest sharply increases.

You can easily add a “Cloud of Labels” on the WordPress site if you go to the Appearance → Widgets menu and drag the widget into [] tag field in the Sidebar area

However, in this case, the tag cloud will display all the tags on the site in alphabetical order. You can not sort them differently and, moreover, you can not limit the number of displayed labels. So, if you have more than 100 tags on the site, the cloud will turn out to be huge.

But you can easily fix this situation if you follow our instructions and show only the most popular tags on the site.

Thus, your readers will immediately be able to understand what materials on the site are the most popular, and what to look for.

1. The most popular WordPress tags using the plugin

This method is the simplest. You need to install and activate the free plugin Simple Tags :

After activation, go to the menu Appearance → Widgets there you will have a new widget available Tag Cloud (Simple Tags) :

Drag it to the Sidebar area. In the widget settings, you can set the maximum number of labels to display, specify the font size and color.

You can also specify how the labels are sorted. If you select the parameters as shown in the picture above, the tags will be sorted by the number of their assignments to published posts in descending order:

In other words, now the site will only show the most popular tags in the quantity you specify.

2. The most popular WordPress tags using

This method is slightly more complicated, you will have to edit the theme file functions.php and add this piece of code:

 function wpb_tag_cloud () {
$ Tags = get_tags ();
$ Args = array (
'Smallest' => 10,
'Largest' => 22,
'Unit' => 'px',
'Number' => 10,
'Format' => 'flat',
'Separator' => "",
'Orderby' => 'count',
'Order' => 'DESC',
'Show_count' => 1,
'Echo' => false

$ Tag_string = wp_generate_tag_cloud ($ tags, $ args);

Return $ tag_string;

// Add a shortcode so that we can use it in widgets, posts, and pages
Add_shortcode ('wpb_popular_tags', 'wpb_tag_cloud');

// Enable shortcode execution in text widget
Add_filter ('widget_text', 'do_shortcode');

This code generates the top 10 tags on the site by popularity and adds in brackets the number of mentions of each label in posts.

Then the code creates a shortcode [wpb_popular_tags] and activates the possibility of using shortcodes in ordinary text widgets.

All you have to do after saving this code in functions.php is to add a new text widget to the sidebar and enter the shortcode in it [wpb_popular_tags]

The result will look something like this:

That’s it! We showed you 2 simple ways how to display the most popular Tags on the WordPress site.


Leave A Reply

Your email address will not be published.

Copy Protected by Chetan's WP-Copyprotect.