By Worsoo Digital Agency · Updated December 2, 2026
To add schema markup to a WordPress custom post type, choose a schema type that describes the public page, then connect its properties to fields your editors already use. Set the rule to run on the right pages and test it with at least two different entries.
Suppose a cleaning company has 12 service pages. An editor should be able to change the service area on one page without editing code or changing the other 11. Here’s how to build that setup, choose between a plugin and custom code, and check what your site actually publishes.
Key takeaways
- A WordPress post type organizes content. A schema type describes what that content is about.
- Map each fact to the field that already controls it. A service area should have one place where an editor changes it.
- Give individual entries and archive pages separate rules. A list of services serves a different purpose from a page about one service.
- Test a complete entry, an entry with an empty field, and the archive before applying the setup across your site.
How does schema markup work with WordPress custom post types?
A custom post type gives a group of entries its own place in WordPress. Schema markup gives each published entry a machine-readable description. You decide how the two connect. A post type called services might produce a Service record on each service page, while a post type called team might describe a Person.
The easiest mistake is to match names before reading the page. A WordPress developer might use projects for everything in a portfolio. One entry could be a written case study. Another could be a gallery of photographs. The admin label tells you where the content is stored. The public page tells you what it describes.
WordPress explains how these content groups work in its <a href=”https://developer.wordpress.org/plugins/post-types/” target=”_blank” rel=”noopener”><strong>custom post types handbook</strong></a>. If terms like type, property, and item are new to you, Worsoo’s guide to schema markup covers them with examples. Developer.WordPress.org
Which schema type fits your custom content?

Choose the type that describes the main subject of an individual page. Read its heading, introduction, and main details as a visitor would. If the page explains a service, who provides it, and where it is available, Service is a sensible starting point. Use a more specific type only when the facts support it.
| What the individual page contains | Type to consider | What to check first |
|---|---|---|
| A service customers can book | Service |
Can readers identify the service and its provider? |
| A staff member’s profile | Person |
Does the page identify one person and show the professional details you plan to include? |
| A scheduled workshop | Event or an applicable subtype |
Does the page describe a particular event with an actual date and location or online venue? |
| A product sold by the business | Product |
Do the name, model, and offer details belong to that exact product? |
| A written case study | Article, if it reads as an article |
Is the entry an authored account, or is it mainly a gallery or a list of specifications? |
| A directory of several services | CollectionPage or a relevant list, if useful |
Does the markup describe the collection visitors see? |
A single service page may also contain a WebPage record and a breadcrumb trail supplied by an SEO plugin. Those items describe different parts of the page. Before adding custom post type schema, inspect an existing entry and see what your site already supplies.
For a service page, the <a href=”https://schema.org/Service” target=”_blank” rel=”noopener”><strong>Schema.org Service definition</strong></a> lists properties such as provider, serviceType, and areaServed. Select properties that answer a real question about the service. If the business does not publish a fixed price, leave the price out. Schema.org Type
Which WordPress fields should supply the JSON-LD?
Use the field that an editor would naturally update when a fact changes. The post title can supply the service name. A service-area field can supply the city. A shared business record can identify the provider if the same business delivers every service. Reuse those values wherever the page displays or labels them.
Here’s a field map for a fictional Austin cleaning company. Its WordPress dashboard has a Services section. One entry describes move-out cleaning, and its public page names the provider and the city it serves.
| WordPress content | Example value | JSON-LD property | Editing rule |
|---|---|---|---|
| Entry title | Move-Out Cleaning | name |
Use the current entry’s service name. |
| Service category field | Residential cleaning | serviceType |
Include it when the category describes the service shown. |
| Public service-area field | Austin | areaServed |
Read the value assigned to this entry. |
| Shared provider record | Cedar House Cleaning | provider |
Reuse it only for services this company provides. |
| Current public permalink | The service page’s address | url |
Generate it from the entry so it follows permalink changes. |
What would the service record look like?
This short example shows the facts from the fictional page. On a working site, the template or plugin would fill in the values from WordPress. The example leaves out the permalink because the fictional business has no live page.
{
"@context": "https://schema.org",
"@type": "Service",
"name": "Move-Out Cleaning",
"serviceType": "Residential cleaning",
"provider": {
"@type": "Organization",
"name": "Cedar House Cleaning"
},
"areaServed": {
"@type": "City",
"name": "Austin"
}
}
One detail matters here: the city belongs to the service area. It says where customers can receive the service. It does not establish that the company has a physical office in Austin. If a business serves five cities from one office, keep the office address and service areas in separate fields.
For a custom implementation, WordPress provides the <a href=”https://developer.wordpress.org/reference/functions/get_post_meta/” target=”_blank” rel=”noopener”><strong>get_post_meta function</strong></a> to read metadata for a particular post ID and key. Give your developer the actual field key as well as the label you see in the editor. A dashboard label like “Service area” may correspond to a key such as service_city. Developer.WordPress.org
Should you use a schema plugin or custom code?
Use a plugin when it can target the correct post type and read the fields you need. Choose custom code when the rule depends on details your plugin cannot express reliably. A useful way to decide is to give each option one ordinary entry and one awkward entry, then compare their output.
| Approach | Good fit | Main tradeoff |
|---|---|---|
| Schema plugin with field mapping | Each entry uses the same layout and simple text fields. | Available post types, field sources, and rules depend on the plugin and plan. |
| Custom code maintained by a developer | Entries have multiple service areas, related provider records, or conditional fields. | Someone must maintain the field map when the site changes. |
| Hand-written JSON-LD on one page | A one-off page has a clear owner and rarely changes. | Each manual copy can drift away from the facts visitors see. |
Try the awkward entry first. Suppose the move-out cleaning page lists Austin, but a commercial cleaning page lists three cities. Find out whether your setup returns three separate places, a readable text value, or an internal field ID. A result such as "areaServed": 482 is a clue that the setup is reading a database reference instead of the public place name.
If an editor and a developer share the work, record the field key, expected value, and test URL in Worsoo’s SEO audit template. “The city field should output Austin; it currently outputs 482” is a clear repair request.
How do you set up custom post type schema in WordPress?
Start with one individual entry on a private test copy of the site. Map a small set of fields, confirm how the rule handles empty values, and check where it runs. Once it works on a normal entry, try a second entry with different content before applying the setup across the post type.
- Write down the post type key. The dashboard might say “Services” while the registered key is
service. Check the actual key in the post type settings or ask the person who registered it. - Save the current output. Open an existing service page and record the items already present. Pay attention to any
Service,Organization,WebPage, or breadcrumb records so you know what your new rule will add. - Limit the rule to individual entries. Select the relevant post type and its single-entry pages. In custom code, a developer can use
is_singular( 'service' )ifserviceis the registered key. The service archive needs its own decision. - Map the fields and define empty-field behavior. Start with the service name, provider, and service area. If the area field is blank and optional, omit that property. Keep the rest of the service record if it still describes the page accurately.
- Change one value through the WordPress editor. On the test site, change one entry’s service area from Austin to Round Rock. Follow your normal publishing process. Check the visible page and its JSON-LD for the new city.
- Check another entry and the archive. A different service should keep its own city. The directory should still describe a collection of services. Restore the test value before moving the verified rule to the live site.

A common fault becomes obvious in step six. If every service now says Round Rock, the rule may be reading a shared setting. If the archive describes only the last service in the list, the code may be taking the current entry from a listing loop. Both failures can produce readable JSON. You catch them by checking whose facts appear on each URL.
How do you test the published pages?
Test three URLs: a complete entry, an entry with a missing optional field, and the archive. Check the actual names, places, and providers in each result. A tool can read a well-formed record even when the record describes the wrong service, so a green check alone does not finish the review.
Use the Schema Markup Validator to inspect Schema.org items and their values. Use Google’s Rich Results Test when the page targets a search feature Google supports. A general Service record has no standalone Google rich result, so an empty rich-results report can be consistent with a readable service record. Google explains the distinction in its <a href=”https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data” target=”_blank” rel=”noopener”><strong>introduction to structured data</strong></a>. developers.google.com
Before closing the task, check that:
- The service name matches the entry a visitor opened.
- The provider is the business delivering that service.
- The service area reflects what the public page says.
- Blank optional fields do not produce empty place or provider records.
- Two entries with different values keep their own details.
- The archive does not present one service as the subject of the whole directory.
- An ordinary editor can update a fact without touching the JSON-LD.
Keep those three URLs with your technical SEO checklist. They make a useful spot check after a theme change, plugin update, or custom-field rename.
Frequently asked questions
Does every custom post type need its own schema type?
No. Two different WordPress post types can use the same schema type when their pages describe the same kind of thing. You can also leave an entry with accurate basic page markup if a more specific type would add little or would misrepresent the content.
Can WordPress categories or custom taxonomies supply schema values?
Yes, when the term means the same thing as the property you want to fill. A public category called “Residential cleaning” may supply a service type. An internal workflow term such as “Ready for review” describes the editing process and should stay out of the customer-facing service record.
What if several providers use the same service template?
Give each service entry a provider field or a relationship to the correct business record. Test two entries supplied by different businesses. Changing the provider on one test entry should update that entry’s visible details and markup while the second entry keeps its original provider.
Should a custom post type archive have the same markup as an entry?
An archive usually lists several entries, while an individual page describes one main item. Review the archive on its own terms. If you add list markup, match the items visitors can see on that archive page and make sure each points to the correct individual entry.
Can I paste JSON-LD into the WordPress editor?
A Code block is useful for showing a code example to readers. For working markup across a custom post type, use a schema plugin or a template that outputs a JSON-LD script. That lets editors change their usual fields and keeps them from maintaining a second copy by hand.
Start with one entry, then check its neighbor
The best test of schema markup for WordPress custom post types is an ordinary edit. Change one fact on a test entry, confirm it reaches the visible page and structured data, and check that the next entry keeps its own facts. That gives you a repeatable test for future changes.
If your service areas, staff details, or product fields appear on the wrong pages, contact Worsoo for a structured data review. Send one individual entry, its archive URL, and the field that behaves incorrectly. Those details give our team a specific problem to trace.