Custom taxonomies don't work

Hi there,

I migrated my site today and everything seems to be in working order except for the custom taxonomies attached to my custom post types.

I can no longer add or edit tags on my custom post types in the editor.

Any ideas on how to fix this? It’s an important functionality for me to have.

Thanks in advance.

Hi, Moxie! Sorry you’re having this problem. Custom taxonomies are things I use a lot, and they are all working for me. So let’s try some troubleshooting on your site.

What error message are you seeing?

How are you creating the taxonomies?

I’m not getting any error messages. I just can’t add tags to my custom posts in the editor. Clicking on Add doesn’t do anything, nor does clicking on 'Choose from most used tags". I also cannot view or edit the tags on my older posts. Everything else on the page is functional.

The taxonomies were created via the ACF plugin, which is also what I used to create the custom post types.

Thanks for helping me out!

Could you try deactivating ACF? Everything you’ve created with it will still be in the database, so you won’t lose anything, and you should then be able to tag your posts using the built-in system.

I’ve just installed ACF on one site, used it to create a non-hierarchical taxonomy for posts, and then tried tagging posts. It’s all working perfectly for me.

I wonder if you have a caching issue. Could you try holding down the Shift key while refreshing the post edit screen?

I should clarify that the custom taxonomies don’t work ON the custom post types. If I apply them to the default post type, they work. Deactivating ACF deactivates my custom post types as well as the custom taxonomies, so that defeats the purpose. I could try adding them via my functions file, but the plugin functionality is preferable.

I have also cleared three different caches (browser, LiteSpeed and my host’s CDN) to try and fix it but that did not help.

So this is a custom taxonomy for a custom post type?

Yes.

I couldn’t figure it out and considering the importance of having custom tags on my custom post types, I just migrated back to WordPress.

Thanks for your help!

You might no longer be interested, but I have been able to reproduce your issue. It’s isolated to the non-hierarchical taxonomies’ (i.e. like tags) metaboxes on the edit screen of a custom post type. Metaboxes on regular posts, and hierarchical taxonomies (i.e. like categories) on any post type work fine.

What also works fine is adding non-hierarchical taxonomies via Quick Edit (accessible from the list of custom post types), so that’s how to do it for now while I troubleshoot this some more.

The cause is odd because the correct JavaScript file is being loaded but, for some reason, the relevant function is not firing on the custom post type edit screen when the Add button is clicked. (And, I say, it’s working fine for regular posts and hierarchical taxonomies.)

UPDATE: I’ve now found the source of the problem, but it’s getting late here, so I will come back to this in the morning.

3 Likes

I have found the solution. I have documented it and created a Pull Request to fix it at Update post.js to fix bug in metaboxes created for custom non-hierarchical taxonomies by KTS915 · Pull Request #1392 · ClassicPress/ClassicPress · GitHub

4 Likes

The PR has now been merged, so this bug will be fixed in version 2.1 of ClassicPress. In the meantime, anyone needing this functionality can use the latest nightly build of version 2.0.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.