Skip to content
Web Design & Development

How to Get WordPress Custom Post Types Right

Defining new content types in WordPress, such as products, events or case studies, with their own fields, templates and admin screens.

Marcus Adeyemi Technical Director 2 min read 22 views
How to Get WordPress Custom Post Types Right

The key figures

Registration
register_post_type() defines a new type
Taxonomies
custom categories can be attached
Fields
often added with custom fields or blocks
Portability
types defined in themes disappear when the theme changes

Why this is worth getting right

Custom post types keep structured content organized, instead of forcing everything into posts and pages.

Do this, not that

Do

  • Register post types in a plugin, not the theme
  • Define custom taxonomies where needed
  • Use clear admin labels
  • Plan URL structures before launch
  • Create templates for each type

Don’t

  • Putting everything in standard posts
  • Defining content types in themes
  • Changing URL slugs after launch without redirects
  • Too many overlapping types

When to bring in help

Our advice Bring in help when WordPress sites manage structured content such as events or listings.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Web Design & Development