Title: Plugin causes 0 term count
Last modified: April 17, 2019

---

# Plugin causes 0 term count

 *  Resolved [parakeet](https://wordpress.org/support/users/parakeet/)
 * (@parakeet)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/)
 * I think LH User Taxonomies is causing erroneous post counts for terms in the 
   taxonomy to which my Users are attached.
 * Namely, my “company” taxonomy, which is now shared by several Post Types (ie.“
   Article”, “Viewpoint”) and the Users.
 * When I try to display the count of a term like `$topmost->count`, sadly it is
   0.
    Trying to fix it with wp_update_term_count_now does NOT successfully update
   the counts – UNTIL I disable the LH User Taxonomies plugin.
 * Some kind of conflict going on here?
 * I’m going to need to fix it, because I would like to have both a User and Post
   Types utilising said “company” taxonomy at the same time. Is it possible?
 * Thanks.

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

 *  Thread Starter [parakeet](https://wordpress.org/support/users/parakeet/)
 * (@parakeet)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11440322)
 * In fact, it’s worse than that… it’s not that wp_update_term_count_now actually
   fixes the count…
 * Re-enabling LH User Taxonomies has the same effect… term counts displayed all
   go back to 0! 🙁
 *  Thread Starter [parakeet](https://wordpress.org/support/users/parakeet/)
 * (@parakeet)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11442107)
 * I believe this is because, with LH User Taxonomies enabled, `$term->count` returns
   a count of **Users** with this term, not of Posts.
 * This is an incorrect assumption for my use case.
 * Need a way to differentiate the count, or I’m going to have to write another 
   way to force counting of posts, ie. do a corresponding WP_Query and do found_posts–
   but seems like a shame that would introduce extra load.
 * Any ideas, please?
 * [https://github.com/shawfactor/lh-user-taxonomies/pull/7#issuecomment-484405082](https://github.com/shawfactor/lh-user-taxonomies/pull/7#issuecomment-484405082)
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11456198)
 * yes it does and I’m not sure there is a solution I want to implement.
 * As it is sharing taxonomies across users and post objects is problematic anyway
   as wordpress has no way of telling if the object id is for an user or post so
   even if you do two queries on the shared taxonomy then the count you come up 
   with could be wrong anyway.
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11474495)
 * I am resolving this for good order, note I´ve yet to look at the other issue 
   which I suspect is a solvable bug.
 * pete
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11474496)
 * That being the isue you added regarding removing terms on users, in the other
   thread.
 *  Thread Starter [parakeet](https://wordpress.org/support/users/parakeet/)
 * (@parakeet)
 * [7 years ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11531554)
 * I recently disabled LH User Taxonomies and moved the user taxonomy piece to an
   ACF field on User.
 * This means the taxonomy, which remains registered to a Post Type, is uninterrupted
   by also being registered to a User.
 * It’s a shame not to accomplish it all through LH User Taxonomies, and the ACF
   piece will also cause a certain elegance or complication for me – but, as you
   say, WordPress seem to struggle with facilitating it.
 * Thanks.
 *  Plugin Author [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * (@shawfactor)
 * [7 years ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11539393)
 * [@parakeet](https://wordpress.org/support/users/parakeet/) that won´t work.
 * As i said if you share a taxomony between posts and users then you cannot get
   an accurate term count. It is impossible as there is nothing in the database 
   that flags the relationship as being post or user related and posts and users
   are in two different tables
 * The only solution is to make sure taxonomies only relate to a objects in a single
   database table.

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

The topic ‘Plugin causes 0 term count’ is closed to new replies.

 * ![](https://ps.w.org/lh-user-taxonomies/assets/icon-128x128.png?rev=1104699)
 * [LH User Taxonomies](https://wordpress.org/plugins/lh-user-taxonomies/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lh-user-taxonomies/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lh-user-taxonomies/)
 * [Active Topics](https://wordpress.org/support/plugin/lh-user-taxonomies/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lh-user-taxonomies/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lh-user-taxonomies/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [shawfactor](https://wordpress.org/support/users/shawfactor/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/plugin-causes-0-term-count/#post-11539393)
 * Status: resolved