AI-generated WordPress plugin

Generate a custom post type plugin

Custom post types are a daily need: portfolios, team members, case studies, locations. You can register them in 20 lines of PHP but "just 20 lines" ends up buried in a theme functions.php file where they do not belong — because if you change themes, your content structure disappears.

A dedicated plugin is the correct home. We generate one that registers the CPT, taxonomies, fields, admin columns, REST endpoints, and includes sensible template stubs that the active theme can override.

5 min to ZIP 24 h live sandbox WP Coding Standards

Why generate it instead of installing an existing plugin?

CPT UI + ACF covers most cases and is what many agencies ship. It works. It also pulls in two plugins, an admin UI that editors poke at, and ACF Pro fees if you want repeaters or flexible content.

A generated plugin declares the CPT and fields in code. No admin UI to misconfigure. Field storage is the same (post meta), the REST is automatically exposed, and the admin list columns are pre-built for what matters (e.g., location, city, status) instead of showing the default title-date.

It is also portable: copy-paste to another site and everything works after activation.

Example prompt

This is the kind of description that generates this plugin. You can start from it and tweak whatever you need before hitting generate.

Plugin name: Acme Case Studies

Register CPT acme_case with slug /case-studies/<slug>/.
Taxonomy acme_case_industry (hierarchical) and acme_case_tag (flat).

Fields (stored as post meta):
- client_name (string)
- project_year (int)
- project_url (url)
- summary (text, <= 160 chars)
- services (multi-select from a fixed list: "Design","Dev","Consulting")

Admin list columns: featured image thumb, client_name, industry (first term), project_year, status.
Bulk filters: industry, year.

Block editor: use core blocks. Add a sidebar panel for the custom meta fields via Gutenberg register_plugin.

REST: CPT auto-exposed at /wp/v2/acme_case with custom meta included in _embedded.

Templates:
- archive-acme_case.php (grid of cards)
- single-acme_case.php (hero + summary + content)
Shipped as fallbacks; themes override.

Flush rewrite rules on activate/deactivate.

What the generated plugin typically includes

  • register_post_type + register_taxonomy with full args
  • Meta registered via register_post_meta (REST visible, sanitized)
  • Gutenberg sidebar panel for custom fields (no ACF required)
  • Admin columns with sortable year and filterable industry
  • REST endpoints auto-exposed with meta
  • Fallback templates the theme can override
  • Rewrite flush on (de)activation; cleanup guard on uninstall

Fields, taxonomies, slug, capabilities, and whether the admin sidebar or meta boxes are used come from the prompt. Importing existing posts into the new CPT is a separate task describable in the same prompt.

Frequently asked questions

What happens if I deactivate the plugin?

Posts stay in the DB but become inaccessible because the CPT is gone. Reactivating restores them. We document this on the readme so nobody panics.

Can two plugins share a taxonomy?

Yes. Declare the taxonomy shared-scope in the prompt and the plugin registers it conditionally to avoid double-registration errors.

Ready to generate your plugin?

Create a free account, verify your email, first generation is on us.

Related:CPTContent typesAdmin