Skip to main content

wp taxonomy list

Overview

List every registered taxonomy — built-in (category, post_tag) and custom (product_cat, genre, etc.). Use this to discover valid taxonomy slugs before managing terms.

What It Does

wp taxonomy list reads from get_taxonomies() and output each registered taxonomy with its label, slug, whether it's public, and which post types it applies to.

Syntax

wp taxonomy list [OPTIONS]

Arguments & Options

FlagDescription
--fields=FIELDSFields: name, label, public, hierarchical, object_type
--format=FORMATtable, json, csv, yaml

Basic Usage

List all taxonomies

wp taxonomy list

Output:

+-------------+------------+--------+--------------+
| name | label | public | hierarchical |
+-------------+------------+--------+--------------+
| category | Categories | 1 | 1 |
| post_tag | Tags | 1 | 0 |
| product_cat | Categories | 1 | 1 |
+-------------+------------+--------+--------------+

Get taxonomy slugs only

wp taxonomy list --field=name

Include object types

wp taxonomy list --fields=name,label,object_type --format=table

Real-World Scenarios

Verify a custom taxonomy exists before using it

if wp taxonomy list --field=name | grep -q "^genre$"; then
wp term create genre "Science Fiction" --slug=sci-fi
else
echo "Taxonomy 'genre' does not exist"
fi

Quick Reference

wp taxonomy list                          # All taxonomies
wp taxonomy list --field=name # Slugs only
wp taxonomy list --format=json # JSON output

Next Steps