>
Black Friday: Kinsta 50% off for 3 months · WPX first month $1.80 · InMotion up to 73% off — See the 4 hosting deals →

Custom Post Type Generator

Generate a basic public custom post type registration.

  • Free, no sign-up
  • Runs in your browser
  • 100% private — runs in your browser
Sharjeel Tahir

By Sharjeel Tahir

WordPress & Technical SEO Specialist · Lahore, Pakistan

What do I need to enter?

YOUR RESULT

Ready to use

Use the example inputs or enter your own values.

Your input is processed in this browser.

Be the first to rate this tool

Your favourites

Recently used

    Generate a basic public custom post type registration. Creates register_post_type on init with REST support, an archive and common editor supports. Enter function prefix, post type key, plural label, singular label. Update the result, inspect it, then copy or download the output.

    METHOD

    How does this tool work?

    Creates register_post_type on init with REST support, an archive and common editor supports.

    Enter function prefix, post type key, plural label, singular label. Update the result, inspect it, then copy or download the output. Reset restores the example inputs so you can start a new calculation.

    Example inputs: Function prefix: studio · Post type key: project · Plural label: Projects · Singular label: Project.

    The four inputs map directly onto the generated code. The function prefix names the code the tool writes for you, the post type key is the short machine name WordPress stores the type under, and the plural and singular labels are the human-readable names shown in the admin — “Projects” in a list, “Project” when you add one. The example inputs show the shape: function prefix “studio”, post type key “project”, plural label “Projects”, singular label “Project”. Change all four to fit your own site before you copy the result.

    What comes out is a register_post_type call hooked on init, the point in WordPress loading where post types are registered. It comes with REST support, so the type is available through the WordPress REST API, an archive, so the type gets its own listing page, and the common editor supports, so the editing screen carries the usual fields. Update the result after changing any input, inspect it, then copy or download it. Reset restores the example inputs, so you can start again from the known-good example.

    BEFORE YOU USE THE RESULT

    What are the assumptions and limitations?

    Post type keys must be unique and no more than 20 characters. Save permalinks once after activation; do not flush rewrite rules on every request.

    The key is the part that bites. Post type keys must be unique — two types cannot share one — and no more than 20 characters long, so keep the key short and descriptive: “project” is seven characters, which leaves thirteen spare. A key that collides with an existing type will not behave as expected, so check what your site already registers before you settle on a name. Labels have no such limit, so put the readable wording there and keep the key terse.

    The second rule is about permalinks. Save permalinks once after activation so WordPress rebuilds its rewrite rules with the new type included; until you do, the archive and single pages for the type may return 404 errors. Do not flush rewrite rules on every request — once after activation is enough, and again only if you change the type's settings.

    What the generated code gives you

    The output is a starting point, not a finished plugin: a register_post_type call on init with REST support, an archive and the common editor supports. REST support means the type is reachable through the REST API, which is also what the block editor uses to load and save content. The archive means the type has a listing page of its own, so a “Projects” type can show all projects in one place. The common editor supports mean the editing screen includes the usual fields, so you can start writing straight away.

    Because the tool only produces the result for you to review, nothing on your live website changes when you use it. Production changes remain a separate step: take the copied or downloaded code, add it to your theme or a small plugin, activate it, and then save permalinks once.

    Choosing a post type key

    Pick the key before the labels. It must be unique across your whole site and no more than 20 characters, so a short lowercase word is the safest choice — “project”, “event” or “recipe” rather than a long phrase. The key is what WordPress stores and what templates and queries refer to, so changing it later means updating every reference; the labels, by contrast, can be reworded any time without touching the data.

    How to use this tool

    Enter your values or add your file, then read the result right away. No account, no install, no waiting — and your files are never uploaded anywhere.

    Worked example

    Take the example inputs: function prefix “studio”, post type key “project”, plural label “Projects”, singular label “Project”. The key “project” is 7 characters, leaving 13 of the 20-character limit spare. Copy the generated register_post_type code, add it to your site, and save permalinks once after activation so the new archive works.

    Common questions

    Do I need an account?

    No. This tool works in a modern browser with JavaScript enabled. Your inputs are not submitted to a server by the tool.

    Can I save the result?

    Use Copy for the textual result or Download for a local file. Image tools download a generated image when one is available.

    Will it change my live website?

    No. It produces a result for you to review. Production changes remain a separate step.

    Do these tools work on my phone?

    Yes. The tools run in your phone’s browser — no app to install. For file tools, use your phone’s file picker to add a file.

    Are my files uploaded to a server?

    No. The tools run in your browser, so your files stay on your device and are never sent anywhere.

    What code does this tool generate?

    A register_post_type call hooked on init, with REST support, an archive and the common editor supports. You copy or download the result and add it to your theme or a small plugin yourself — the tool does not change your live website.

    How long can a post type key be?

    No more than 20 characters, and it must be unique. The example key “project” is seven characters, which leaves thirteen spare. Keep the key short and put the readable wording in the labels instead.

    Do I need to save permalinks after adding the post type?

    Yes, save permalinks once after activation so WordPress rebuilds its rewrite rules with the new type included. Until you do, the archive and single pages for the type may return 404 errors.

    Does the generated post type have an archive page?

    Yes. The generated code includes an archive, so the type gets its own listing page — a “Projects” type can show all projects in one place, not only as single entries.

    Can two post types use the same key?

    No. Post type keys must be unique across your site. If the key you want is already taken by another type or a plugin, pick a different key or add a short prefix of your own.

    Keep working

    Explore related tools for the next part of your website task, or discuss a project if you need help applying the result.

    Discuss a project