woo-custom-fields

Work with WooCommerce product attributes, custom meta fields, taxonomies, custom product tabs, and variation data. Use when adding custom data to products, orders, or customers.

17 stars

Best use case

woo-custom-fields is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Work with WooCommerce product attributes, custom meta fields, taxonomies, custom product tabs, and variation data. Use when adding custom data to products, orders, or customers.

Teams using woo-custom-fields should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/woo-custom-fields/SKILL.md --create-dirs "https://raw.githubusercontent.com/OrcaQubits/agentic-commerce-skills-plugins/main/dist/antigravity/woocommerce-commerce/.agent/skills/woo-custom-fields/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/woo-custom-fields/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How woo-custom-fields Compares

Feature / Agentwoo-custom-fieldsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Work with WooCommerce product attributes, custom meta fields, taxonomies, custom product tabs, and variation data. Use when adding custom data to products, orders, or customers.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# WooCommerce Custom Fields & Attributes

## Before writing code

**Fetch live docs**:
1. Web-search `site:developer.woocommerce.com product data custom fields` for product custom fields guide
2. Web-search `site:developer.wordpress.org plugins metadata` for WordPress metadata API
3. Web-search `woocommerce custom product attributes programmatically` for attribute creation

## Product Attributes

### Global Attributes

Defined in WooCommerce > Attributes — shared across all products:
- Stored as custom taxonomies: `pa_{attribute_slug}` (e.g., `pa_color`, `pa_size`)
- Terms are the possible values (Red, Blue, Small, Large)
- Can be used for filtering, variations, and layered navigation
- Managed via `wc_create_attribute()`, `wc_update_attribute()`, `wc_delete_attribute()`

### Custom (Local) Product Attributes

Per-product attributes — not global taxonomies:
- Stored in product meta as part of `_product_attributes` array
- Visible on the product page under "Additional Information" tab
- Set via `$product->set_attributes()` with `WC_Product_Attribute` objects

### Setting Attributes Programmatically

Create `WC_Product_Attribute` objects:
- `set_id()` — 0 for custom attributes, taxonomy ID for global
- `set_name()` — taxonomy name (`pa_color`) or custom label
- `set_options()` — array of term IDs (global) or string values (custom)
- `set_visible()` — show on product page
- `set_variation()` — used for variations

## Product Meta

### Core Meta Keys

| Key | Description |
|-----|-------------|
| `_price` | Current active price |
| `_regular_price` | Regular price |
| `_sale_price` | Sale price |
| `_sku` | Stock Keeping Unit |
| `_stock` | Stock quantity |
| `_stock_status` | instock / outofstock / onbackorder |
| `_weight`, `_length`, `_width`, `_height` | Dimensions |
| `_virtual`, `_downloadable` | Product type flags |

### Custom Meta

- `$product->update_meta_data( '_my_custom_field', $value )` then `$product->save()`
- `$product->get_meta( '_my_custom_field' )` — retrieve value
- Prefix custom keys with `_` to hide from the Custom Fields meta box

### Adding Product Edit Fields

Use hooks to add fields to the product edit screen:
- `woocommerce_product_options_general_product_data` — General tab
- `woocommerce_product_options_inventory_product_data` — Inventory tab
- `woocommerce_product_options_shipping_product_data` — Shipping tab
- `woocommerce_product_options_advanced` — Advanced tab
- Save with: `woocommerce_process_product_meta` action

### Field Rendering Functions

- `woocommerce_wp_text_input( $args )` — text input
- `woocommerce_wp_textarea_input( $args )` — textarea
- `woocommerce_wp_select( $args )` — dropdown select
- `woocommerce_wp_checkbox( $args )` — checkbox
- `woocommerce_wp_hidden_input( $args )` — hidden field

## Custom Product Tabs

### Adding to Product Page

Filter `woocommerce_product_tabs` to add, remove, or reorder tabs:
- Return array with `title`, `priority`, `callback` keys
- Remove default tabs by unsetting keys: `description`, `additional_information`, `reviews`

### Adding to Product Edit (Admin)

Filter `woocommerce_product_data_tabs` to add tabs in the product editor:
- Return array with `label`, `target`, `class`, `priority`
- Render panel content via `woocommerce_product_data_panels` action

## Order Meta

- `$order->update_meta_data( '_my_field', $value )` then `$order->save()`
- `$order->get_meta( '_my_field' )` — retrieve value
- HPOS-compatible: always use CRUD methods, never `update_post_meta()`

## Customer Meta

- `$customer->update_meta_data()` / `$customer->get_meta()` via `WC_Customer`
- Or `update_user_meta()` / `get_user_meta()` for WordPress user meta

## Custom Taxonomies

### Registering Custom Taxonomies

Use `register_taxonomy()` on `init` hook:
- Associate with `product` post type for product classification
- Set `show_in_rest` for REST API / block editor support
- Hierarchical (like categories) or flat (like tags)

## Best Practices

- Use global attributes for values shared across products (color, size, brand)
- Use custom meta for product-specific data not used in filtering
- Prefix custom meta keys with underscore to hide from the generic meta box
- Always use CRUD methods (`update_meta_data` / `get_meta`) for HPOS compatibility
- Sanitize all input before saving: `sanitize_text_field()`, `wc_clean()`, `absint()`
- Escape all output: `esc_html()`, `esc_attr()`, `wp_kses_post()`

Fetch the WooCommerce product data and metadata documentation for exact hook names, field function signatures, and attribute API before implementing.

Related Skills

spree-admin-customization

17
from OrcaQubits/agentic-commerce-skills-plugins

Customize the Spree v5 Admin Dashboard — Tailwind 4 + Hotwire/Turbo/Stimulus stack, the `Spree.admin.navigation` declarative API (v5.2+) for menu items, partial injection slots (`store_nav_partials`, `store_products_nav_partials`, `store_orders_nav_partials`, `settings_nav_partials`), the Admin SDK components + form builder, custom dashboard reports, the Page Builder for storefront editing, and theme management. Use when adding admin pages, injecting UI into existing screens, or building admin extensions.

shopify-customers

17
from OrcaQubits/agentic-commerce-skills-plugins

Manage Shopify customers — Customer Account API, new vs classic accounts, Multipass SSO, customer segmentation, B2B company accounts, metafields, and marketing consent. Use when working with Shopify customer data.

sf-customers

17
from OrcaQubits/agentic-commerce-skills-plugins

Manage Salesforce Commerce customers — B2C (customer objects, customer groups, segmentation, SLAS authentication, wishlists) and B2B (Account/Contact, buyer groups, buyer permissions, self-registration). Both platforms share Data Cloud for unified customer profiles and consent management.

saleor-customers

17
from OrcaQubits/agentic-commerce-skills-plugins

Manage Saleor customers and staff — customer accounts, registration, addresses, staff users, permission groups, and authentication. Use when working with user management.

nlweb-prompts-customization

17
from OrcaQubits/agentic-commerce-skills-plugins

Customize NLWeb's LLM prompts and per-Schema.org-type behavior via `prompts.xml` and `site_types.xml` — covers the `<promptString>` template format, `<returnStruc>` JSON schemas, prompt inheritance, decontextualization/ranking/generate templates, per-site overrides, and pitfalls of editing prompts in place. Use when tuning answer quality, supporting a new domain, or localizing prompts.

medusa-customers

17
from OrcaQubits/agentic-commerce-skills-plugins

Manage Medusa v2 customers — customer profiles, email and social authentication, customer groups, addresses, and account management. Use when working with customer data and auth.

bc-customers

17
from OrcaQubits/agentic-commerce-skills-plugins

Work with BigCommerce customers — Customer API, customer groups, addresses, stored instruments, attributes, Customer Login API (SSO), and customer segmentation. Use when building customer-facing features or integrating customer data.

woo-testing

17
from OrcaQubits/agentic-commerce-skills-plugins

Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.

woo-shipping

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.

woo-setup

17
from OrcaQubits/agentic-commerce-skills-plugins

Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.

woo-security

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement WooCommerce security — nonces, capabilities, input sanitization, output escaping, data validation, PCI compliance considerations, and WordPress security best practices. Use when hardening a WooCommerce store or reviewing security posture.

woo-plugin-dev

17
from OrcaQubits/agentic-commerce-skills-plugins

Create WooCommerce extensions/plugins — file structure, main plugin file, activation/deactivation hooks, custom database tables, autoloading, and WordPress plugin API. Use when building new WooCommerce extensions or structuring plugin code.