How to fix the WordPress issue where a custom taxonomy’s term_taxonomy_id remains 0 when updating a post?

Solution:

If you encounter this error, check the table wp_term_taxonomy in your database. Make sure the column term_taxonomy_id is set with the following options:

  • Auto-increment
  • Primary key
  • Unique

This should resolve the issue.