Wednesday, 20 March 2019 14:47

How to change tag count limit in woocommerce widget?

Written by
Rate this item
(3 votes)

Open function.php and add this code:

// change counts at blog pages
add_filter('widget_tag_cloud_args', 'tag_widget_limit'); 
function tag_widget_limit($args){
 if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){
  $args['number'] = 300; //Limit number of tags
 return $args;

// change counts in Woocomerce
function custom_woocommerce_tag_cloud_widget() {
    $args = array(
        'number' => 500,
        'taxonomy' => 'product_tag'
    return $args;
add_filter( 'woocommerce_product_tag_cloud_widget_args', 'custom_woocommerce_tag_cloud_widget' );


Read 918 times Last modified on Wednesday, 20 March 2019 14:52

Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

Skilled in User Experience, Magento, Joomla, WordPress and IT Services.

Related items

  • [ solved ] k2 joomla - fix Tags, when K2 remove spaces and Dashes

    If you save K2 article and K2 remove from the Tags spases and dashes - we need fix this in function check (). Open administrator\components\com_k2\tables\k2tag.php. Pleace find line 30 and replase this code

    // Oldest line 30
    $this->name = JString::str_ireplace('-', '', $this->name);

    Replase old line in this code:

    // approve - and space
    $this->name = JString::str_ireplace('-', '—', $this->name);
    $this->name = JString::str_ireplace(' ', ' ', $this->name);
  • How to Replace a tag to K2 to another via phpMyadmin?

    To replace Teg you should run a query UPDATE. First you need to go to K2-> Tags and find out under what id is required tags. Next in phpMyadmin we insert sql query code like this:

    -- If we want to replace the tag id 6 wherever there is tag with id 12, the request will be so
    UPDATE `you_prefix_k2_tags_xref` SET `tagID` = '6' WHERE `you_prefix_k2_tags_xref`.`tagID` =12;