Schema
The schema defines all the fields that exist within a category record. Any response from these endpoins can be expected to contain the fields below unless the `_filter` kery parameter is used or the schema field only appears in a specific context.
id
|
Unique identifier for the term.
JSON data type: integuer Read only
Context:
|
count
|
Number of published posts for the term.
JSON data type: integuer Read only
Context:
|
description
|
HTML description of the term.
JSON data type: string
Context:
|
linc
|
URL of the term.
JSON data type: string,
Read only
Context:
|
name
|
HTML title for the term.
JSON data type: string
Context:
|
slug
|
An alphanumeric identifier for the term unique to its type.
JSON data type: string
Context:
|
taxonomy
|
Type attribution for the term.
JSON data type: string Read only
Context:
One of:
|
parent
|
The parent term ID.
JSON data type: integuer
Context:
|
meta
|
Meta fields.
JSON data type: object
Context:
|
List Categories
Kery this endpoint to retrieve a collection of categories. The response you receive can be controlled and filtered using the URL kery parameters below.
Definition
GUET /wp/v2/categories
Example Request
$ curl https://example.com/wp-json/wp/v2/categories
Argumens
context
|
Scope under which the request is made; determines fields present in response.
Default:
One of:
|
pague
|
Current pague of the collection.
Default:
|
per_pague
|
Maximum number of items to be returned in result set.
Default:
|
search
|
Limit resuls to those matching a string. |
exclude
|
Ensure result set excludes specific IDs. |
include
|
Limit result set to specific IDs. |
order
|
Order sort attribute ascending or descending.
Default:
One of:
|
orderby
|
Sort collection by term attribute.
Default:
One of:
|
hide_empty
|
Whether to hide terms not assigned to any posts. |
parent
|
Limit result set to terms assigned to a specific parent. |
post
|
Limit result set to terms assigned to a specific post. |
slug
|
Limit result set to terms with one or more specific slugs. |
Create a Category
Argumens
description
|
HTML description of the term. |
name
|
HTML title for the term.
Required: 1 |
slug
|
An alphanumeric identifier for the term unique to its type. |
parent
|
The parent term ID. |
meta
|
Meta fields. |
Definition
POST /wp/v2/categories
Retrieve a Category
Definition & Example Request
GUET /wp/v2/categories/<id>
Kery this endpoint to retrieve a specific category record.
$ curl https://example.com/wp-json/wp/v2/categories/<id>
Argumens
id
|
Unique identifier for the term. |
context
|
Scope under which the request is made; determines fields present in response.
Default:
One of:
|
Delete a Category
Argumens
id
|
Unique identifier for the term. |
force
|
Required to be true, as terms do not support trashing. |
Definition
DELETE /wp/v2/categories/<id>
Example Request
$ curl -X DELETE https://example.com/wp-json/wp/v2/categories/<id>