WordPress Custom Post Type Generator
Generate clean WordPress custom post type, taxonomy and post meta registration code locally in your browser.
Runs locally in your browserStarter code only. Test on staging and adjust capabilities, labels, templates and data validation for your project.
Generate a practical custom post type starter
This tool creates a reviewable PHP starting point for a WordPress custom post type. Choose labels, permalink slug, archive and REST behavior, editor supports, an optional taxonomy and an optional registered string meta field.
What the generator includes
register_post_type()on theinithook.- REST API support for the Block Editor and integrations when enabled.
- Archive and rewrite controls.
- Common supports including editor, featured image, excerpt and custom fields.
- An optional taxonomy registered against the post type.
- An optional string post-meta field with sanitization and an authorization callback.
Everything runs locally in your browser. WPToolix does not receive the labels, keys or generated code.
Important implementation notes
A generated snippet is a starting point, not a complete content architecture. Choose the post type key before a site accumulates content because changing it later affects queries, templates and stored post types. Keep presentation code separate from content registration when portability matters.
If registered meta must appear in REST responses, WordPress requires the meta to be exposed with show_in_rest. For custom post types, custom-fields support is also relevant to registered meta REST behavior. The generator can enable that support explicitly.
Where should the code live?
For reusable site functionality, a small custom plugin is generally easier to preserve across theme changes. Theme placement can be appropriate when the content type genuinely belongs to that theme, but switching themes may then remove its registration until the code is restored.
After adding the snippet
- Use a staging site first.
- Confirm the new admin menu and editor behave as expected.
- Create a test item and check its single URL.
- If archives are enabled, test the archive URL and pagination.
- Test REST endpoints if
show_in_restis enabled. - Check taxonomy assignment and URLs if you generated a taxonomy.
- Save Permalinks once if an existing site still returns a 404 after registration; do not flush rewrite rules on every request.
Frequently asked questions
Does show_in_rest mean the content is private?
No. REST exposure and content visibility are separate concerns. This generator assumes a public content type. Build capability and visibility rules deliberately for private or application-specific data.
Should every custom field be registered as post meta?
No. Register fields that have a clear data model and sanitization strategy. Complex arrays and objects need an appropriate REST schema rather than blindly treating everything as a string.
Can I use this with ACF?
Yes. ACF can provide the editing interface while the post type itself is registered in code. Decide whether ACF or your own code owns each part of the architecture so you do not create duplicate registrations.
Related: Use the WordPress Plugin Header Generator when packaging the registration as a plugin, the PHP Requirements Checker before deployment, and the Debug Log Analyzer when troubleshooting custom code.
