Skip to content

WP 6.2 Categories-list block wrongly displays & counts non-existing uncategorized posts #49983

@Humanify-nl

Description

@Humanify-nl

Description

The categories-list block does not behave accordingly.

This is in Dutch but should illustrate the problem:

image

It shows 9 posts as uncategorized (that do not exist). When clicked on this 'niet-gecategoriseerd' (= uncategorized), it shows zero posts, because none are actually uncategorized. 'Show empty categories' setting is also not turned on.

Here we see the category list in admin:
image
9 posts are said to be uncategorized, but they aren't. Clicking on the numbered link shows no posts.

Empty categories should never show. There should never be a link to an empty uncategorized category archive that nobody wants.

Opinionated remark:

It is 2023, site editor is out of beta, but we need basic functionality like taxonomies to work. This is an age old WP problem: "No category" should mean "no category".

There is no use for a 'uncategorized' category, it defeats the whole purpose of what a category is. This old fallback catch-all mechanism needs to be revised. Make it optional instead of mandatory. Remove it, put it in a filter (wp_use_default_category, __return_true) for those poor souls who actually use it. I'm pretty sure nobody is going to miss it.

Step-by-step reproduction instructions

  • Add a couple posts
  • Make sure all of them have a category (not uncategorized)
  • Add the categories-list block in a category template
  • Notice the above described problem (uncategorized seems attached as a hidden category for all posts)

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.2
  • No Gutenberg plugin

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TestingNeeds further testing to be confirmed.[Block] CategoriesAffects the Categories Block[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions