Title: Remove Post Count Parentheses From Widget
Last modified: August 19, 2016

---

# Remove Post Count Parentheses From Widget

 *  [norbiu](https://wordpress.org/support/users/norbiu/)
 * (@norbiu)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/remove-post-count-parentheses-from-widget/)
 * When I insert the Archives widget and check the “Show Post Counts”, it wraps 
   the number in parentheses. Is there any way to edit that within functions.php
   without modifying the core files? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [st3vi3](https://wordpress.org/support/users/st3vi3/)
 * (@st3vi3)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/remove-post-count-parentheses-from-widget/#post-1489341)
 * would love to know this too – i have searched and search
 * i managed to do this with the wp_categories_list in my child theme as follows:
 *     ```
       // remove parentheses from category list and add span class to post count
       function categories_postcount_filter ($variable) {
       $variable = str_replace('(', '<span class="post-count"> ', $variable);
       $variable = str_replace(')', ' </span>', $variable);
          return $variable;
       }
       add_filter('wp_list_categories','categories_postcount_filter');
       ```
   
 * alas replacing **wp_list_categories** with **wp_get_archives** has no impact.
 * Anyone any ideas?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/remove-post-count-parentheses-from-widget/#post-1489342)
 * archives are a bit different:
 *     ```
       add_filter('get_archives_link', 'archive_count_no_brackets');
       function archive_count_no_brackets($links) {
       $links = str_replace('</a>&nbsp;(', '</a>&nbsp;', $links);
       $links = str_replace(')', '', $links);
       return $links;
       }
       ```
   
 *  [st3vi3](https://wordpress.org/support/users/st3vi3/)
 * (@st3vi3)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/remove-post-count-parentheses-from-widget/#post-1489343)
 * alchymyth
    THANK YOU SO MUCH!
 * hmmm *wonders why it is $links and not $variable*
    – how does one know what parameter
   to pick?!
 * php nube here 🙁
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/remove-post-count-parentheses-from-widget/#post-1489344)
 * > hmmm *wonders why it is $links and not $variable*
   >  – how does one know what
   > parameter to pick?!
 * you can make one up – as long as it does not conflict with one of the global 
   variables used by the core of wordpress 😉

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Remove Post Count Parentheses From Widget’ is closed to new replies.

## Tags

 * [parentheses](https://wordpress.org/support/topic-tag/parentheses/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/remove-post-count-parentheses-from-widget/#post-1489344)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
