Categories box not showing on post edit pages

For all who have the problem just with WordPress Blocks/Gutenberg, here is the solution I was looking for a long time.

When you create a new taxonomy, make sure you’ve set show_in_rest to true. Otherwise it will not appear in Block editor.

https://developer.wordpress.org/reference/functions/register_taxonomy/
Whether to include the taxonomy in the REST API. Set this to true for the taxonomy to be available in the block editor.

register_taxonomy(
  'new-category',
  'post',
  [
    'public' => false,
    'rewrite' => false,
    'show_ui' => true,
    'show_in_rest' => true,
    'hierarchical' => true,
  ]
);

Leave a Comment