In your update_count_callback function do a check for $post->post_status and don’t increment your count if post_status is not private.
See this excellent answer on writing a custom update_count_callback callback function.
Edit:
Misread the question. To override the existing default for the category taxonomy you can create a function that overrides the global $wp_taxonomies variable
function change_category_arg() {
global $wp_taxonomies;
if ( ! taxonomy_exists('category') )
return false;
$new_arg = &$wp_taxonomies['category']->update_count_callback;
$new_arg->update_count_callback = 'your_new_arg';
}
add_action( 'init', 'change_category_arg' );
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- get_categories for custom post type with a specific custom taxonomy attached
- Could not insert term into the database
- How can I add the featured image functionality to a custom taxonomy?
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- Weird behaviour when adding terms/term_taxonomies programmatically
- wp_update_nav_menu_item() to insert categories
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- How to make custom taxonomy check boxes like ‘Categories’
- How to create non-unique sub-category slugs?
- How to get next previous category in same taxonomy?
- Display only deepest category on a single post?
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- Wrap a chosen category name with div
- wp_list_categories, Add class to all list items with children
- Display empty taxonomy terms with get_terms()
- Return category slug / title from category ID
- Connecting WordPress gallery to custom categories (taxonomy)
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- Update taxonomy value of post type in query
- How to query posts from specific authors and categories using WP_query?
- How to get the depth of a category’s subcategories
- New categories are now going to 404s
- Add custom taxonomy under the category title
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- Get multidimensional array that reflects category hierarchy
- List Terms in Category
- How to get category URL with the slug?
- Display Slug instead of Name
- Force a user’s posts category
- Search Posts / Pages with multiple options?
- ACF: Display category name using taxonomy field
- Show Available Taxonomy List with Current Category
- How to filter out Categories for specific post types on WordPress Admin?
- Exclude a category from the_category in the single post page
- Taxonomy name repeating when showing 2 posts from each category
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- New Categories Not Shown In the Post Edit Page
- Shortcodes not working in category or tag description
- Filtering multiple categories via the URL
- Display specific categories by ID
- Display Posts Loop for each parent and for each Child
- Why don’t posts show up in my categories on the frontend?
- Flat category URLs but retaining hierarchy?
- Drop posts from categories in MySql
- Customize category page for different custom taxonomies
- Get posts under a category with SQL
- How many categories can WordPress handle before performance suffers?
- Custom taxonomy template for categories
- Wacky taxonomy in wordpress
- Question on using custom structures for categories
- Notice: Trying to get property of non-object in : custom fields category
- Display sibling categories on category page
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- WP REST API not retrieving all categories
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- List just subcategory and products of active category page in Woocommerce
- WP 4.7 in_category change?
- Illegal string offset ‘taxonomy’ in
- Style a category from category list
- How to schedule categories?
- Let user select their own category
- Copy post taxonomy?
- Setting selected term_id with wp_dropdown_categories?
- creating categories programmatically
- Combining these queries? (Same taxonomy term + same category as post)
- sidebar troubles, taxonomy trouble
- Category post count is not correct
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- How can i change sort category view starting from child then parent, not alphabetically
- How to set acf color field as background color to product category
- Filtering posts in category by tag URL
- Bulk assign posts to a category using SQL (MySQL)
- get taxonomy list in a page in the wordpress
- Image Upload Custom Form Field for Category and Custom Taxonomy
- outputting taxonomy hierarchy
- Confused about category.php template – not working
- Filter custom taxonomy posts via AJAX
- Why use hierarchical taxonomies instead of many custom taxonomies?
- How get all media from a posts category by db?
- How to Manage and link certain custom taxonomy?
- Display Taxonomies in loop with template args
- Grouping parent categories into sections
- get_adjacent_post_link excluded_terms ignored
- Match two taxonomies to display a specific content
- Category base 404 – fix
- Display only the latest post
- Return selected categories only in custom page meta box?
- get IDs from links categories
- Multiple Parent Category URLs
- Chained drop-down menu for custom taxonomy using chained.js
- Display only one level subcategory in wordpress
- Converting Categories (with ACF fields) to custom taxonomies
- Woocommerce custom taxonomy order
- Hook action when create new category [duplicate]
- Taxonomy term RestApi data 10 rows limitions
- Images as Categories