Inicio - Documentación - POM AI - 14 MCP - WordPress taxonomy tools - `wp_get_taxonomies`: list taxonomies

wp_get_taxonomies: list taxonomies

Lists the public taxonomies on this site. The orientation call before any taxonomy work.

Arguments

None.

Permissions

mcp:read and wp:content:read. No WordPress capability required.

What it returns

An items list. Each entry carries:

Field Meaning
name The taxonomy key, such as category or post_tag
label The human name
hierarchical Whether terms can nest
rest_base Its REST base

hierarchical decides how terms behave

It is the field worth reading, because it changes what a term operation means:

Hierarchical — like categories. Terms can have a parent, so creating one without specifying parent puts it at the top level, and deleting a parent affects its children.

Non-hierarchical — like tags. There is no parent, and passing one is meaningless.

An assistant that has not read this will pass parent to a tag taxonomy, or omit it for a category that belonged under another. Neither raises an error; both produce a taxonomy that is subtly wrong.

Only public taxonomies

A taxonomy registered as non-public does not appear here and cannot be reached by any tool in this chapter.

So this list is the definitive answer to "what taxonomies can MCP touch on this site". If something is missing, it is either non-public or not registered.

Custom taxonomies

On a POM site, custom taxonomies are usually created through the theme's content model and appear here once registered.

If one you expect is absent, the content model may not have been applied, or the taxonomy may be non-public. See Configure POM Theme settings.

Which post types use which taxonomy

Not reported here. This tool lists taxonomies; it does not say which post types they apply to.

To find that out, read the post type with wp_get_post_types and look at what it supports, or check the site's configuration.

Using it well

At the start of any taxonomy job:

List the taxonomies and tell me which are hierarchical.

Then size each one:

Count the terms in each taxonomy.

Two read calls, and you know the shape of the site's classification before agreeing to change any of it.

What it does not do

Common problems

Symptom Cause
A known taxonomy is missing It is registered as non-public
Only category and post_tag No custom taxonomies, or the content model is not applied
A generic listing tool returns nothing for it There is no generic term listing tool; see below

That last row is worth expanding: there are dedicated tools for categories and tags, but listing the terms of an arbitrary custom taxonomy has no dedicated tool. wp_count_terms accepts any taxonomy, so it can confirm terms exist even where a listing is unavailable.

Related