Synthetic Industry

Troubleshooting guide · updated 2026-10-11

Adding a custom content type to WordPress: where to register it, what to call it, how its addresses behave

The registration choices that are hard to change later: placement, naming and the 20-character limit, and the address pattern.

A content type is a decision about the long term

A custom post type gives repeating content, such as team members, events or properties, its own place in the admin, its own list and its own pages. It also fixes three things that are awkward to change after the site has real content: the identifier stored in the database against every entry, the address pattern visitors and search engines learn, and the place where the registration code lives. Treat those three as design decisions and settle them before writing a line of template.

  • Identifier: how it is stored.
  • Address pattern: how it appears to visitors.
  • Home of the code: what happens when the theme changes.

Put the registration in a plugin

The plugin handbook recommends registering post types in a plugin rather than in a theme, so that if you change theme the content type and its entries are still available. If the registration sits in the theme, switching themes means the type is no longer registered, so it is unavailable in the admin and on the site until that theme is active again, although the entries stay stored. The registration function is attached to the init action, which the handbook calls a good hook; it must run after the theme setup hook and before the admin initialises. A small, single-purpose plugin is therefore the right container, and it can carry the field definitions and the templates with it.

  • Keep one plugin per content type or per site, not per template.
  • Do not rely on the theme to register anything the content depends on.

Name it carefully

The handbook gives three naming rules. Prefix the identifier with a short token tied to your plugin, theme or site, because generic names such as product may collide with another plugin or theme, and a duplicate can only be resolved by disabling one of the conflicting types. Do not start with wp_, which WordPress core uses. And keep the identifier to 20 characters at most, because the post_type column in the database is currently a VARCHAR field of that length. A name that looks fine in the code can fail silently if it is too long, so check the length of the final string, including the prefix.

  • Write the identifier in lower case with underscores or hyphens, and count it.
  • Check the name against installed plugins before choosing it.

The address pattern

By default the base of a type's addresses is its identifier, which is rarely what you want to show visitors. A rewrite setting with a slug changes the base, for example to a plural word. The handbook warns that a generic slug can clash with another plugin or theme and that a more specific one is safer. Changing the slug after launch changes every entry's address, so the old addresses need redirects. Decide the pattern with the people who care about the web address, and check that no existing page already uses the same path.

  • Pick a base that reads naturally and is not already a page.
  • Plan redirects before any later change of slug.

What to settle before building, and how the paid job is accepted

Before building, list the fields each entry needs, how many entries you expect, whether visitors will search or filter them, and who edits them. The content-type job has a published test price of GBP 650 and covers one type with up to twelve fields and one taxonomy, an archive and a single-entry template. It is accepted when a fresh staging copy shows the type and its fields with no manual step, filled and partly filled entries render without notices, the archive and a single entry return HTTP 200, and the identifier is prefixed and within 20 characters. Search and filtering are a separate job.

  • Send a sample entry broken into fields and a sketch of the pages, never real personal data.
  • Prices are untested proposals and payment follows the agreed checks.

Sources and limits

  • WordPress plugin handbook: registering custom post types Checked 2026-10-11.
    • Registration with register_post_type() should happen after after_setup_theme and before admin_init, and the init action is a good place; the page recommends putting it in a plugin rather than a theme so content stays portable.
    • Prefix identifiers with something tied to your plugin, theme or site, avoid starting with wp_, and keep the identifier within 20 characters because the post_type database column is currently a VARCHAR of that length.
    • The rewrite slug sets the post type's URL base; the default is the identifier itself; a generic slug can clash with another plugin or theme.