I am new to Magento 2 and been wondering how to remove wishlist counter text.

I had tried generating a language pack using this command:

bin/magento i18n:collect-phrases -o "app/design/frontend/vendor/theme/i18n/en_US.csv" app/design/frontend/vendor/theme

in the newly generated files with 2 columns, I changed

%1 items



I also tried replicating the one on Magento_Wishlist then put it in my custom theme but it does not work either.

Also, I tried this accepted solution but still no luck.


  • do you need to remove from header dropdown ? – hweb87 May 21 '18 at 10:36
  • @hweb87 No. I repositioned my Wishlist but I didn't remove any of its elements. I just wanted to remove the text in the counter because I will style it as a badge(like facebook notification count). – user67757 May 21 '18 at 10:59

Could you please try this :

"%1 items","%1"

Then clear cache and deploy :

php bin/magento clear:cache
php bin/magento setup:static-content:deploy
| improve this answer | |
  • I already did that but it doesn't work. – user67757 May 22 '18 at 10:13

Although I agree with Daniele that it is better to use translation dictionary, it is useful to know other possible methods:

– you can override createCounter function in Vendor/Module/CustomerData/Wishlist.php

* Create button label based on wishlist item quantity
* @param int $count
* @return \Magento\Framework\Phrase|null
protected function createCounter($count)
    return $count;

– you can update link template ( by default it is view/frontend/templates/link.phtml ) and change

<span data-bind="text: wishlist().counter" class="counter qty"></span>


<span data-bind="text: wishlist().counter.replace(/[^0-9]+/g, '')" class="counter qty"></span>

| improve this answer | |

Did you try to specify the module in your language pack?

Like this

"%1 items","%1",module,Magento_Wishlist

Then flush cache and reload your page

| improve this answer | |
  • I haven't tried that since the csv file that was generated only has 2 columns and I don't know which module does each phrases belong. – user67757 May 22 '18 at 10:13

I already figured out how to remove "items" in wishlist counter.

Instead of modifying the translation pack, I extended


to my custom module then override the function createCounter(), remove the text "items" in "%1 items"

protected function createCounter($count)
        if ($count > 1) {
            return __('%1', $count);
        } elseif ($count == 1) {
            return __('1');
        return null;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.