Back to Community

How to Fix Gutenberg Category Display and Filtering Issues

22 threads Sep 9, 2025 PluginGutenberg

Content

Many WordPress users working with the Gutenberg editor encounter challenges when trying to display, filter, or customize categories and other taxonomies within blocks. This comprehensive guide addresses the most common category-related issues and provides practical solutions based on community knowledge.

Common Category Problems in Gutenberg

Based on numerous support threads, these are the most frequent category-related issues users face:

  • Categories not showing in Gutenberg for custom post types
  • Inability to restrict post navigation to the same category
  • Difficulty filtering categories shown in block interfaces
  • Challenges with custom category displays in Query loops
  • Limited styling options for category list blocks

Solutions and Workarounds

1. Custom Post Type Category Display

If categories aren't showing for your custom post type in Gutenberg, ensure your taxonomy registration includes these critical parameters:

'show_in_rest' => true,
'supports' => array('title', 'editor', 'categories')

Additionally, verify that your custom taxonomy is properly associated with your custom post type in your registration code or plugin settings (like CPT UI).

2. Same-Category Post Navigation

The core Next Post and Previous Post blocks don't include options to restrict navigation to the same category. However, you can implement this functionality with a custom PHP filter:

add_filter( 'next_post_link', 'my_adjacent_post_link', 10, 5 );
add_filter( 'previous_post_link', 'my_adjacent_post_link', 10, 5 );

function my_adjacent_post_link( $output, $format, $link, $post, $adjacent ) {
    $previous = 'previous' === $adjacent;
    
    if ( ! ( $previous && is_attachment() ) ) {
        $post = get_adjacent_post( true, '', $previous, 'category' );
    }
    
    if ( ! $post ) {
        // Handle case where no post is found
        return '';
    }
    
    // Return your custom output
    return $output;
}

3. Filtering Categories in Block Interfaces

To filter which categories appear in Gutenberg interfaces, you have several approaches:

  • Use JavaScript with wp.data.select('core').getEntityRecords('taxonomy', 'category', {exclude: [16,17]})
  • Implement server-side filtering with rest_prepare_category (though context handling can be challenging)
  • Consider using the HierarchicalTermSelector component with custom filtering logic

4. Query Loop Category Filtering

For displaying posts from specific categories in Query loops:

  • Uncheck "Inherit query from template" to enable custom filtering
  • Use the taxonomy filter options to select specific categories
  • Note that related posts by category/tag/author requires custom development or plugins currently

5. Category Block Styling

To customize the appearance of category list blocks:

  • Use the Additional CSS section in Global Styles (Appearance > Editor)
  • Target specific blocks with custom CSS classes
  • For WooCommerce category blocks, check the WooCommerce Blocks plugin documentation

When to Consider Feature Requests

Many category-related limitations in Gutenberg represent missing features rather than bugs. The community has identified several valuable enhancements:

  • Taxonomy Term block for custom taxonomies
  • Related posts filtering in Query blocks
  • Category description editing with Gutenberg
  • Transformations between Categories and Tag Cloud blocks

If you need functionality that doesn't exist, consider submitting a feature request to the Gutenberg GitHub repository where developers track enhancement ideas.

Alternative Approaches

For complex category displays that core blocks cannot handle:

  • Create custom blocks for specific category display needs
  • Use block patterns or reusable blocks for consistent category layouts
  • Consider dedicated plugins for advanced category displays and filtering

Remember that the block ecosystem continues to evolve, and new solutions for category management appear regularly.

Related Support Threads Support