Skip to main content
Development April 8, 2026 · 8 min read

Custom Taxonomy in WordPress (register_taxonomy) Guide

Custom taxonomies let you organize content beyond categories and tags. This guide covers labels, hierarchical settings, rewrite rules, and a clean register_taxonomy example.

FP

FyrePress Team

WordPress Developer Tools

TL;DR

  • Custom taxonomies group content beyond default categories and tags.
  • register_taxonomy controls labels, UI, hierarchy, and URLs.
  • Flush permalinks once after adding or changing rewrite rules.

When to Use a Custom Taxonomy

Use a custom taxonomy when you need a domain‑specific grouping that doesn’t fit the built‑in category/tag model. Examples: “Property Types” for real estate, “Difficulty” for recipes, or “Department” for staff bios.

Hierarchical vs. Non‑Hierarchical

  • Hierarchical behaves like categories (parent/child terms).
  • Non‑hierarchical behaves like tags (flat list).

register_taxonomy Example

Add this to functions.php or a plugin. Replace slugs and labels to match your project.

function fyrepress_register_taxonomy() {
    $labels = array(
        'name'              => 'Topics',
        'singular_name'     => 'Topic',
        'search_items'      => 'Search Topics',
        'all_items'         => 'All Topics',
        'parent_item'       => 'Parent Topic',
        'parent_item_colon' => 'Parent Topic:',
        'edit_item'         => 'Edit Topic',
        'update_item'       => 'Update Topic',
        'add_new_item'      => 'Add New Topic',
        'new_item_name'     => 'New Topic Name',
        'menu_name'         => 'Topics',
    );

    $args = array(
        'hierarchical'      => true,
        'labels'            => $labels,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array('slug' => 'topic'),
    );

    register_taxonomy('topic', array('post', 'your_cpt'), $args);
}
add_action('init', 'fyrepress_register_taxonomy');

FyrePress tool: Use the Custom Taxonomy Generator to create a tailored config instantly.

Rewrite Rules & Permalinks

If you change the taxonomy slug or attach it to a custom post type, visit Settings → Permalinks once to flush rewrite rules. This updates the URL structure and prevents 404s.

Frequently Asked Questions

What is the difference between categories, tags, and custom taxonomies?

Categories and tags are built‑in taxonomies. Custom taxonomies let you define your own grouping logic and labels.

Can a taxonomy be attached to multiple post types?

Yes. Pass an array of post types to register_taxonomy.

Do I need to flush rewrite rules?

Yes. Visit Settings → Permalinks once after adding or changing rewrite rules.

Hierarchical or non‑hierarchical?

Hierarchical works like categories with parents. Non‑hierarchical works like tags.

Key Takeaways

  • Custom taxonomies unlock flexible content organization.
  • Labels and rewrite rules shape the editor UI and URLs.
  • Flush permalinks after changes to avoid 404s.
Tags: Taxonomy CPT Development WordPress

Generate a taxonomy config instantly

Use the Custom Taxonomy Generator to create a ready‑to‑paste snippet.