[wp-trac] [WordPress Trac] #64853: Inconsistent Post Count in Category Taxonomy
WordPress Trac
noreply at wordpress.org
Thu Mar 12 17:55:25 UTC 2026
#64853: Inconsistent Post Count in Category Taxonomy
--------------------------------+-----------------------------
Reporter: phunsanit | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.9.4
Severity: normal | Keywords: has-patch
Focuses: ui, administration |
--------------------------------+-----------------------------
Description
There is a discrepancy between the post count displayed in the Category
List (edit-tags.php) and the actual number of posts displayed when
clicking through to the Post List (edit.php?category_name=...).
Environment
Platform: WordPress Admin Dashboard
Affected Pages: * /wp-admin/edit-tags.php?taxonomy=category
/wp-admin/edit.php?category_name=history
Steps to Reproduce
Create a category named "History".
Publish 1 post assigned to the "History" category.
Create a 2nd post assigned to the "History" category, but set its
status to "Scheduled" (Future).
Navigate to Posts > Categories (edit-tags.php). Observe the Count
column for "History".
Click the count number (1) to view the posts in that category.
Expected Result
The count in the Category List should reflect the total number of items
managed within that category (2), or the Post List should filter by
"Published" by default to match the count.
Actual Result
Category List: Displays a count of 1 (only counting Published posts).
Post List: Displays 2 items (1 Published + 1 Scheduled).
Note: There are no active filters applied in the Post List, yet the
numbers do not align.
Suggested Fix/Reasoning
The internal function _update_post_term_count() currently only includes
the publish post status. To improve UX and consistency for site
administrators, the update_post_term_count_statuses filter should be
utilized to include the future status in the count calculation.
A Quick Technical Note
Since you mentioned earlier that you don't have a "Published" filter
active, WordPress's default behavior is to show all statuses you have
permission to see (Draft, Scheduled, Published) on the edit.php screen,
which is why the "2" appears there while the "1" stays on the category
summary.
Would you like me to provide the specific PHP code snippet to fix this so
your "Scheduled" posts are always included in that count?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64853>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list