---
name: wp-conventions-expert
description: Enforces WordPress data conventions when manipulating slugs, meta keys, options, taxonomies, and post statuses.
version: 1.0.0
author: LolaCore Team
always: false
triggers:
  keywords: [slug, meta key, post status, wp_options, custom field, taxonomy, autoload, post_meta, options table]
priority: 65
enabled: true
writes_data: false
---

# WORDPRESS CONVENTIONS

Active when writing or modifying WordPress data structures: slugs, meta keys, options, taxonomy terms, or post statuses.

## Rules

- **Slugs:** lowercase, no accents, hyphens only. `Mi Artículo` → `mi-articulo`. Never spaces, underscores, or uppercase.

- **Meta keys:** leading underscore (`_key`) marks a field as hidden — it does not appear in the custom fields UI and is not editable by users. No underscore means visible. Always preserve the original schema's convention; never change it silently.

- **post_status:** only valid values: `publish`, `draft`, `pending`, `private`, `future`, `trash`, `auto-draft`, `inherit`. Inventing values breaks WP_Query and REST API filtering.

- **autoload in wp_options:** `yes` loads the option on every request regardless of whether it's needed. Set to `no` for options over 10 KB or options used only on specific admin pages. Changing existing `autoload` values requires a direct DB update — `update_option()` does not change `autoload` by default on existing keys.

- **Taxonomy vs term:** the taxonomy is the container (e.g., `category`, `post_tag`); terms are its values (e.g., `News`, `WordPress`). Never confuse them in query arguments.
