Custom Post Types and Custom Fields in WordPress: Examples, ACF and Similar Tools, Registering Them in Code, Templates and SEO
Custom post types and custom fields in WordPress explained with real examples, ACF and code options, templates, archive pages, SEO for structured content.

On this page
- The three building blocks
- Examples by type of business
- Why structured content beats free-form pages
- Plan the content model before building
- Tools for custom fields and post types
- Registering a custom post type in code
- Templates: how items are displayed
- SEO for custom post types
- Common mistakes
- Letting visitors filter and search items
- Lists that update themselves
- Who adds items, and what they can touch
- Custom fields on WooCommerce products
- Importing existing items in bulk
- Quick check: what content needs its own type?
- When to get help
- FAQs
- A custom post type is a separate kind of content such as Doctors, Projects or Courses, and custom fields store its fixed details like fees, location or duration.
- Plan the content model on paper first: list each type, its fields, its taxonomies and how pages should display and filter it.
- Register post types in a plugin, not the theme, so the content survives a redesign, and give archives and single pages proper titles, descriptions and schema.
Custom post types in WordPress are extra content types you add alongside posts and pages, such as Doctors, Projects, Properties or Courses, and custom fields are the structured details stored with each item, such as qualification, location, price or duration. Together they let editors fill in a simple form while the website displays every item in a consistent layout, with archive pages, filters and search built in.
This guide explains the building blocks, gives examples for different businesses, compares ACF and similar tools with registering in code, and covers templates and SEO so the new content actually ranks.
The three building blocks
- Custom post type (CPT): a new content type with its own admin menu, list screen and URLs, for example /projects/riverside-villa/.
- Custom fields: extra data attached to each item, stored in post meta. Text, numbers, dates, images, files, select lists, relationships to other items.
- Custom taxonomies: ways to group items, like categories for posts. Examples: Specialty for doctors, City for properties, Level for courses.
Think of the CPT as the cabinet, taxonomies as the labelled drawers, and fields as the form inside each folder.
Examples by type of business
| Business | Post type | Useful fields | Taxonomies |
|---|---|---|---|
| Hospital or clinic | Doctors | Qualification, experience, OPD timings, languages, photo | Specialty, branch |
| Real estate developer | Projects | RERA number, configurations, carpet area range, possession status, brochure PDF | City, status |
| Coaching institute | Courses | Duration, batch start date, mode (online or classroom), eligibility | Exam, level |
| Manufacturer | Products | Specifications table, material, sizes, datasheet | Product line, industry |
| Interior designer | Portfolio | Location, area, style, gallery, before and after images | Room type, style |
| Restaurant group | Outlets | Address, timings, phone, delivery links, map | City |
For more on particular industries, see real estate website features and our websites for doctors and clinics page.
Why structured content beats free-form pages
- Consistency: every doctor or project looks the same, however many editors add them.
- Easier editing: staff fill in labelled fields instead of fighting a page builder layout.
- Filtering and search: visitors can filter projects by city or courses by exam, because the data is structured.
- Reuse: one doctor entry can appear on their profile, the specialty page and the branch page without copying.
- Future-proof: a redesign changes templates, not hundreds of hand-built pages.
If you only have three team members who rarely change, ordinary pages are fine. CPTs pay off when there are many similar items or they change often.
Plan the content model before building
Write it down on paper or in a sheet before any setup:
- List every content type and roughly how many items each will have.
- For each, list fields, mark required ones, and note the field type (text, number, date, image, choice).
- Decide which fields are filters (usually taxonomies) and which are just details.
- Note relationships, for example which doctors work at which branch.
- Sketch the archive page and single item page, and decide the URL pattern.
Include this in your website brief so the developer can quote it accurately. Changing the model after hundreds of entries exist is far more work than getting it right first.
Tools for custom fields and post types
- ACF (Advanced Custom Fields): the most widely used. The free version handles post types, taxonomies and most fields; Pro adds repeaters, flexible content, galleries, options pages and ACF blocks.
- Meta Box, Pods and similar: comparable feature sets with different pricing and developer styles.
- Page builder dynamic content: Elementor Pro and similar builders can display field values in their templates, which suits sites already built that way.
- Core WordPress: register everything in code with register_post_type and register_post_meta, with no plugin dependency.
Whichever you choose, check how it stores data and whether you can export the field definitions as code or JSON for version control. Avoid tools that lock data into an unusual format.
Registering a custom post type in code
Registering in a small site plugin keeps things light and portable. A minimal example:
<?php
/* Plugin Name: Site Content Types */
add_action( 'init', function () {
register_post_type( 'project', array(
'label' => 'Projects',
'public' => true,
'has_archive' => true,
'rewrite' => array( 'slug' => 'projects' ),
'menu_icon' => 'dashicons-building',
'show_in_rest' => true,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
) );
} );
Set show_in_rest to true so the block editor works with it. After adding a new post type, visit Settings, Permalinks and click Save to refresh the URL rules, or the new pages return a 404 error.
Put this in a plugin, not the theme's functions.php. If it lives in the theme, a redesign or theme switch makes all the content disappear from the admin, even though it is still in the database. Our guide to plugin vs custom code explains that split.
Templates: how items are displayed
In classic themes, WordPress uses single-project.php for one item and archive-project.php for the listing, falling back to single.php and archive.php. In block themes you create the same templates in the Site Editor and insert field values with block bindings or a fields plugin's blocks. Page builders let you design a single template once and apply it to every item.
Show fields in a sensible order with clear labels, hide empty fields instead of printing blank labels, and use the excerpt or a short summary field on archive cards. Our article on custom Gutenberg blocks covers building blocks that display this data.
SEO for custom post types
- Clean URLs: choose a short, readable slug such as /projects/ or /doctors/ and do not change it later without redirects.
- Archive pages need content: add an intro paragraph and a proper title and meta description to the archive page, not just a grid of cards.
- Unique single pages: each item needs enough unique text to be worth indexing. Thin entries with only a title and photo can be set to noindex or improved.
- Schema: map fields to structured data, such as Physician for doctors or Course for courses. See schema markup explained.
- Sitemaps: confirm your SEO plugin includes the post type and leaves out ones that should not be indexed. Our XML sitemaps guide covers this.
- Internal links: link related items, such as a doctor's profile to their specialty page and branch page.
Taxonomy archives (for example /specialty/cardiology/) can rank well if you write a genuine intro for each; otherwise they are near-duplicates and are better set to noindex. Our guide on duplicate content explains why.
Common mistakes
- Registering post types in the theme, so content vanishes on a redesign.
- Using a custom field for something that should be a taxonomy filter, or the reverse.
- Too many plugins each adding their own post types and fields, slowing the admin.
- Forgetting to flush permalinks, causing 404 errors on new items.
- Changing the post type slug after launch without redirects, losing rankings.
If you want a content model planned and built properly, it is part of my WordPress website development work, or you can hire a WordPress developer in India to add it to an existing site.
Letting visitors filter and search items
Once items are structured, filtering is where visitors feel the benefit. Taxonomies power simple filters such as "show projects in Pune" or "show courses for NEET". For filters on field values, such as price range, possession date or experience, use a filtering plugin built for custom fields or a small custom query. Keep filter URLs out of the index (they create endless combinations) while keeping the main archive and key taxonomy pages indexable. Test filters on a phone: a filter panel that covers the whole screen with no clear Apply button loses visitors fast.
Lists that update themselves
A big practical benefit is that every listing on the site updates automatically. Add a new doctor with the Cardiology specialty and the Pune branch, and they appear on the doctors page, the cardiology page, the Pune branch page and the home page team section without anyone editing those pages. Remove a sold-out project from the "Available now" list by changing one field. For businesses that change listings often, this saves hours each month and avoids the classic problem of a former employee still appearing on one forgotten page.
Who adds items, and what they can touch
Decide who will add and edit items. A receptionist adding doctors' timings does not need access to theme settings or plugins. WordPress roles such as Editor and Author, or a custom role created with a role editor plugin, can limit staff to just the relevant post type. Mark important fields as required and add instructions under each field (for example "OPD timings as Mon to Sat, 10am to 2pm") so entries stay consistent. A short screen recording showing how to add one item is worth more than a long manual.
Custom fields on WooCommerce products
WooCommerce products are themselves a custom post type, so you can add custom fields to them too: fabric and care instructions for clothing, compatibility lists for auto parts, or ingredient details for food products. Show them in a specifications tab or table on the product page. For details customers choose, such as size or colour, use WooCommerce attributes and variations rather than custom fields, because those connect to stock, price and filters.
Importing existing items in bulk
If you already have your products, projects or doctors in a spreadsheet, you do not need to type them in one by one. Import tools such as WP All Import can map spreadsheet columns to the post title, content, custom fields and taxonomies, including images from links. Clean the sheet first: one row per item, consistent spellings for filter values such as city names, and dates in one format. Import ten rows as a test, check them on the front end, then import the rest.
Quick check: what content needs its own type?
- List repeating content with the same fields, such as team members, projects or listings. Those are custom post type candidates.
- Check Plugins > Installed Plugins for ACF or a similar fields plugin already in use.
- After adding a post type, open Settings > Permalinks and click Save, then check the new addresses load without 404 errors.
Integrations like this usually run through the WordPress REST API, explained in plain English.
When no existing plugin fits, custom WordPress plugin development explains when bespoke code is worth it.
When to get help
Get help when content is forced into posts and pages, when fields are inconsistent, or when you need custom listings and templates. WordPress website development covers this kind of work, with a written scope before anything starts. You can also send the details through the contact form.
FAQs
What is a custom post type in WordPress?
It is a separate content type beyond posts and pages, such as Projects, Doctors or Courses, with its own admin menu, URLs, archive page and templates.
What is the difference between custom fields and custom post types?
The custom post type is the kind of content; custom fields are the structured details stored with each item, such as price, location or duration.
Do I need ACF to create custom post types?
No. You can register them in code with register_post_type. ACF and similar plugins make it easier for non-developers and add a field editing interface.
Are custom post types good for SEO?
Yes, when each item has useful unique content, a clean URL, schema and internal links. Thin items with almost no text can hurt more than help.
Why do my custom post type pages show a 404 error?
Usually the permalink rules were not refreshed after the post type was added. Go to Settings, Permalinks and click Save Changes.
Will I lose custom post type content if I change theme?
The content stays in the database, but if the post type was registered in the old theme it disappears from the admin. Registering it in a plugin avoids this.
Need help with your website?
I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.


