We recently upgraded a very old WordPress 5.x site to WordPress 6.1.1 and all seemed to go well but then it was reported that some taxonomies were generating new entries randomly.
So we have a taxonomy called article_type, which has entries like
- News - taxonomy=article_type & tag_ID=84 & post_type=post
- Opinion - taxonomy=article_type & tag_ID=90 & post_type=post
Suddenly all these new entries are starting to appear at the top of the list in edit-tags.php page, like this
- 431 - taxonomy=article_type & tag_ID=47033 & post_type=post
- 90 - taxonomy=article_type & tag_ID=47036 & post_type=post
So, the title in each new case is the ID of an existing entry.
The taxonomy is declared like this in code:
/* Article Type */
$labels = array(
'name' => _x( 'Article Type', 'taxonomy general name', 'sage' ),
'singular_name' => _x( 'Article Type', 'taxonomy singular name', 'sage' ),
'search_items' => __( 'Search Article Types', 'sage' ),
'all_items' => __( 'All Article Types', 'sage' ),
'parent_item' => __( 'Parent Article Type', 'sage' ),
'parent_item_colon' => __( 'Parent Article Type:', 'sage' ),
'edit_item' => __( 'Edit Article Type', 'sage' ),
'update_item' => __( 'Update Article Type', 'sage' ),
'add_new_item' => __( 'Add New Article Type', 'sage' ),
'new_item_name' => __( 'New Article Type Name', 'sage' ),
'menu_name' => __( 'Article Types', 'sage' ),
);
$args = array(
'hierarchical' => false,
'labels' => $labels,
'public' => true,
'show_admin_column' => true,
'rewrite' => array( 'slug' => __( 'article-type', 'sage' ) ),
);
register_taxonomy( 'article_type', array( 'post' ), $args );
I wonder if anyone has any ideas where to begin troubleshooting this?
Many thanks!
edit: more info
So it seems when you edit/add a post and use a new article_type, like this:
Then this appears as a new numeric entry at the top of the article_type list. So it seems there's some code that's incorrectly grabbing/updating these and adding this in on a post update!
I have no idea where to even begin to look for this!
edit: more info
I wonder if this has anything to do with it? The only two taxonomies affected: