Skip to content
Settings → register_post_type() PHPWordPress tools

WordPress Custom Post Type Generator

Generate register_post_type() code for WordPress as you type. Set labels, URL slug, editor features, block editor support, menu icon and an optional custom taxonomy, with instant checks for invalid keys.

Did this tool work for you?
Community

User Reviews & Ratings

Be the first to share your experience

About this tool

About WordPress Custom Post Type Generator

WordPress Custom Post Type Generator writes the PHP to register a new content type, such as Products, Events or Portfolio items, and updates the code live as you change the form. Enter the singular and plural labels, and the post type key and URL slug are filled in for you; you can edit both. Choose which editor features the type supports, including title, editor, featured image, excerpt, custom fields, comments, revisions and page attributes. Decide whether it is public, has an archive page, appears in search, uses the block editor through the REST API, and can have parent items like Pages. Pick the admin menu position and a Dashicon, and optionally add a custom taxonomy such as Product Categories, either hierarchical like categories or flat like tags. The generator checks your settings as you type: it flags keys longer than WordPress allows, reserved names like post or order, and settings that do not fit together. All labels are escaped for PHP, so names with apostrophes are safe. Copy the code or download it as a .php file.

WordPress Custom Post Type Generator tool

What people build with custom post types

Structured content beyond posts and pages

Product catalogues

List products with their own URLs and archive, without a full shop plugin.

ExampleA “Product” type with featured image and excerpt, plus a “Product Category” taxonomy, served at /products/.

Portfolios and case studies

Keep projects separate from blog posts with their own templates.

ExampleA “Project” type at /work/ uses single-project.php for a custom case study layout.

Team and testimonials

Store people or quotes as items editors can manage in wp-admin.

ExampleA private “Testimonial” type without public URLs, shown on the homepage through WP_Query.

Events and listings

Create events, jobs or properties with custom fields for dates and prices.

ExampleAn “Event” type with custom fields support stores the event date as post meta.

Courses and lessons

Create a hierarchical type so lessons can sit under courses.

ExampleA hierarchical “Course” type with Page attributes lets editors nest lessons under each course.

Resource libraries

Organise downloads, guides or FAQs as their own content type with a taxonomy.

ExampleA “Resource” type with a flat “Resource Type” taxonomy groups guides, templates and checklists.

Custom post type tips

Avoid the common problems

Flush permalinks once

New post type URLs return 404 until rewrite rules are refreshed. Visit Settings → Permalinks and click Save once after adding the code.

Put it in a plugin

If the code lives in a theme, the content disappears from wp-admin when the theme changes. Our plugin generator gives you a place to put it.

Open Plugin Boilerplate Generator

Keep the key short and unique

Keys are limited to 20 characters and should be specific, like shop_product, to avoid clashes with other plugins.

Add matching templates

Create single-{key}.php and archive-{key}.php in your theme to control how items and listings look.

Exclude private types from search

Turn Public off for internal content like testimonials; the generated code then keeps it out of search and removes its URLs.

Use the Usage tab

The Usage tab gives a WP_Query loop and template file names for your post type, ready to paste.

Featured on

Toolyconvert is listed on these product directories and launch platforms.