WordPress - Get Categories and Tags
Description
Section titled “Description”This module allows querying the categories and tags of a WordPress site. It is useful for getting the IDs needed when creating or updating posts.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”| Field | Description | Example |
|---|---|---|
url | WordPress site base URL | https://my-site.com |
username | WordPress username | admin |
application_password | Application password generated in WordPress | xxxx xxxx xxxx xxxx |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | WordPress credential |
| taxonomy | select | No | Categories or Tags. Default: Categories |
| term_id | text | No | Specific ID. If empty, lists all |
| search | text | No | Search term |
| per_page | number | No | Results per query (1-100). Default: 100 |
| hide_empty | boolean | No | Hide categories without posts |
Output
Section titled “Output”{ "success": true, "terms": [ { "id": 3, "name": "Technology", "slug": "technology", "description": "Technology articles", "count": 15, "parent": 0 } ], "taxonomy": "categories", "total": 8}Usage Example
Section titled “Usage Example”List all categories
Section titled “List all categories”{}Search category by name
Section titled “Search category by name”{ "search": "technology"}Get tags with posts
Section titled “Get tags with posts”{ "taxonomy": "tags", "hide_empty": true}API Used
Section titled “API Used”- Categories Endpoint:
GET /wp-json/wp/v2/categories - Tags Endpoint:
GET /wp-json/wp/v2/tags - Documentation: WordPress REST API - Categories
- Category/tag IDs are used in the Create/Update Post nodes.
- Categories have hierarchy (
parentfield), tags do not. - By default returns up to 100 results to facilitate selection.
Related Nodes
Section titled “Related Nodes”- WordpressCreatePost - Create post assigning categories and tags
- WordpressUpdatePost - Update post categories
- WordpressGetPosts - Get posts filtered by category