create_attribute
Creates a global product attribute (e.g., Weight, Volume) in WooCommerce to enable product variations. Add attribute values by creating terms afterward.
Instructions
Create a global product attribute. After creating, use create_attribute_term to add values (e.g. 500g, 1kg for a Weight attribute).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Attribute name (e.g. 'Weight', 'Volume', 'Pack') | |
| slug | No | Attribute slug (e.g. 'pa_weight') | |
| type | No | Attribute type | select |
| fields | No | Comma-separated fields to return in response | |
| order_by | No | Sort order for terms | menu_order |