What this prompt does
This prompt turns the model into a WordPress developer building a complete custom post type system for a [site_type] site. It produces six artifacts: registration of the [cpt_name] post type, [taxonomy_count] taxonomies, [meta_field_count] meta boxes, a customized admin list table, archive and single templates, and advanced REST and Gutenberg features.
The value is in doing the boring-but-critical parts correctly. The post type registers on the init hook with REST support and the [supports] features, taxonomies register with default terms on activation, and meta fields use register_post_meta() with sanitization callbacks and nonce-checked saves on save_post_{cpt_name}. The admin table gets [column_count] columns showing [custom_columns], sortable via meta queries, plus bulk actions for [bulk_action]. Templates load through the [template_approach].
The sixth step is where it goes beyond a basic generator. It adds custom REST endpoints under [api_namespace] for filtered queries, a pre_get_posts modification for default ordering, a Gutenberg block for embedding [cpt_name] items inside other posts, and an import/export tool for [import_format] bulk content. It also calls for PHPUnit tests on the registration and REST endpoints, since those are exactly the pieces that break silently during later refactors. Doing all of this on the correct hooks with capability checks is what separates a production post type from a fragile one.
When to use it
- Your site needs structured content beyond posts and pages, like a
[cpt_name]type. - You want taxonomies, meta fields, and admin columns generated together, not piecemeal.
- You need the post type exposed in the REST API for a headless or app front end.
- Editors need a usable admin list with sortable columns and filters.
- You want archive and single templates shipped from a plugin, not the theme.
- You need an import/export tool for
[import_format]bulk content management.
Example output
Expect plugin code and structure: a registration block for [cpt_name] at [plugin_directory] with the [menu_icon] icon and [archive_slug] archive, [taxonomy_count] taxonomy registrations with default terms, [meta_field_count] meta fields ([meta_fields]) wired via the [meta_box_approach], an admin table with [custom_columns], archive and single templates showing [posts_per_page] items, plus custom REST endpoints under [api_namespace] and PHPUnit tests.
Pro tips
- Choose
[cpt_name]and[archive_slug]carefully; rewrite rules and URLs depend on them and changing slugs later breaks links. - List your real fields in
[meta_fields]so the generated meta boxes match the content model, not a generic example. - Keep
register_post_meta()andshow_in_reston if a headless front end will read this type. - Match
[supports]to what editors actually need; enabling everything clutters the editor. - Use the
[meta_box_approach]consistently so sanitization and validation stay uniform across fields. - Add the PHPUnit tests for registration and REST endpoints early, since those break quietly after refactors.