Atualizado em 21/10/2026
1
The product tags API allows you to create, view, update, and delete product tags.
| Attribute | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the resource. read-only |
name |
string | Tag name. mandatory |
slug |
string | An alphanumeric identifier for the resource unique to its type. |
description |
string | HTML description of the resource. |
count |
integer | Number of published products for the resource. read-only |
This API helps you to create a new product tag.
Example of how to create a product tag:
curl -X POST https://example.com/wp-json/wc/v3/products/tags
-u consumer_key:consumer_secret
-H "Content-Type: application/json"
-d '{
"name": "Leather Shoes"
}'
JSON response example:
{ "id": 34, "name": "Leather Shoes", "slug": "leather-shoes", "description": "", "count": 0, "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/tags/34" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products/tags" } ] } }
This API lets you retrieve a product tag by ID.
curl https://example.com/wp-json/wc/v3/products/tags/34
-u consumer_key:consumer_secret
JSON response example:
{ "id": 34, "name": "Leather Shoes", "slug": "leather-shoes", "description": "", "count": 0, "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/tags/34" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products/tags" } ] } }
This API lets you retrieve all product tag.
curl https://example.com/wp-json/wc/v3/products/tags
-u consumer_key:consumer_secret
JSON response example:
[ { "id": 34, "name": "Leather Shoes", "slug": "leather-shoes", "description": "", "count": 0, "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/tags/34" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products/tags" } ] } }, { "id": 35, "name": "Oxford Shoes", "slug": "oxford-shoes", "description": "", "count": 0, "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/tags/35" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products/tags" } ] } } ]
| Parameter | Type | Description |
|---|---|---|
context |
string | Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view. |
page |
integer | Current page of the collection. Default is 1. |
per_page |
integer | Maximum number of items to be returned in result set. Default is 10. |
search |
string | Limit results to those matching a string. |
exclude |
array | Ensure result set excludes specific ids. |
include |
array | Limit result set to specific ids. |
offset |
integer | Offset the result set by a specific number of items. |
order |
string | Order sort attribute ascending or descending. Options: asc and desc. Default is asc. |
orderby |
string | Sort collection by resource attribute. Options: id, include, name, slug, term_group, description and count. Default is name. |
hide_empty |
boolean | Whether to hide resources not assigned to any products. Default is false. |
product |
integer | Limit result set to resources assigned to a specific product. |
slug |
string | Limit result set to resources with a specific slug. |
This API lets you make changes to a product tag.
curl -X PUT https://example.com/wp-json/wc/v3/products/tags/34
-u consumer_key:consumer_secret
-H "Content-Type: application/json"
-d '{
"description": "Genuine leather."
}'
JSON response example:
{ "id": 34, "name": "Leather Shoes", "slug": "leather-shoes", "description": "Genuine leather.", "count": 0, "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/tags/34" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products/tags" } ] } }
This API helps you delete a product tag.
curl -X DELETE https://example.com/wp-json/wc/v3/products/tags/34?force=true -u consumer_key:consumer_secret
JSON response example:
{ "id": 34, "name": "Leather Shoes", "slug": "leather-shoes", "description": "Genuine leather.", "count": 0, "_links": { "self": [ { "href": "https://example.com/wp-json/wc/v3/products/tags/34" } ], "collection": [ { "href": "https://example.com/wp-json/wc/v3/products/tags" } ] } }
| Parameter | Type | Description |
|---|---|---|
force |
string | Required to be true, as resource does not support trashing. |