What schema markup does on a WordPress page
Schema is a shared vocabulary for describing what is on a page: this is a recipe, this is a local business, these are its opening hours. Search engines and AI assistants read it instead of guessing from the layout.
WordPress adds almost none by default. A theme prints a title and a post date; it does not tell anyone that the page is an Article, an Organization or a Product. The two routes below add that layer, and both write the same JSON-LD, so pick one and stay with it.
The plugin route: set the type once
An SEO plugin is the faster route and the right one if anyone else edits the site. Rank Math, Yoast and SEOPress all do the same three things; the labels differ.
- Install the plugin and run its setup, which sets Organization and WebSite schema site-wide.
- Pick a default type for posts (Article) and for pages (WebPage), so new content is covered without a decision each time.
- For one important page — a product, a service, an event — open the page, find the Schema tab in the editor sidebar, and add the specific type there.
- Fill only the fields you can verify: name, address, price, dates. Empty fields are dropped, wrong fields are worse than empty ones.
- View the page source and search for
application/ld+json. If nothing appears, the plugin output is off or a cache is serving an old page.
The no-plugin route: JSON-LD in a child theme
Editing the parent theme directly loses the change at the next update. Create a child theme first, or use a code snippets plugin, then hook into wp_head.
- Create the child theme with a
style.cssthat names the parent in aTemplate:line, or add the snippet with a code snippets plugin. - Add a function to the child theme's
functions.phpthat prints a script tag of typeapplication/ld+jsoninsidewp_head. - Build the object as a PHP array and pass it through
wp_json_encode(), so quotes and ampersands are escaped for you. - Load the page and confirm the block appears once, in the head, with no PHP notice above it.
A minimal LocalBusiness node looks like this, with your own values: {"@context"
Add schema to one page, not the whole site
Site-wide Organization schema belongs on every page. A Product, Event or FAQ block does not — it belongs on the page that shows it. In the functions.php route, wrap the output in a condition so it fires only where it should.
is_page( 42 )targets one page by ID, which survives a slug change.is_singular( 'product' )targets every item of a custom post type.is_page_template( 'page-contact.php' )targets a template, useful for a contact or location page.- Never use
is_page( 'contact' )alone if a post shares the slug; the ID is unambiguous.
Article and FAQ schema on posts
Two nodes earn their keep on a normal blog post. Article carries the headline, author, publisher, dates and image. FAQPage carries question and answer pairs, and only when the questions are visible on the page.
The rule that catches most sites: the FAQ text in the JSON must equal the visible text, in the same order. If you drop a question from the page and leave it in the schema, the rich result disappears and Search Console reports a mismatch. Add mainEntity as an array of Question objects, each with acceptedAnswer.text.
Validate before you call it done
Two Google tools, used in this order, catch almost everything. Neither guarantees a rich result; they only confirm the markup is readable and complete.
- Paste the live URL into the Rich Results Test and run it. Fix every item marked as an error before looking at the warnings.
- Paste the same URL into the Schema Markup Validator to see the full graph, including nodes the theme adds.
- In Search Console, open Enhancements after two or three days. Errors appear per type, with the URL that caused them.
- Re-test one page after clearing the cache. A cached HTML page is the most common reason a fix looks like it did nothing.
Fix the four errors WordPress sites actually throw
| What you see | Why | Fix |
|---|---|---|
| Two Organization blocks with different names | Plugin default plus a hand-written block | Keep one. Remove the duplicate or stop the plugin's Organization output |
| JSON syntax error in the validator | Unescaped quotes in a hard-coded string, or a PHP warning printed inside the script tag | Build the array in PHP and encode it with wp_json_encode() |
| Markup present in source, missing in the test | A page cache or CDN is serving the old HTML | Purge the cache, then re-run both tools |
| FAQ or rating mismatch | The schema lists content the page no longer shows | Make the schema follow the visible page, not the other way round |
Where to run schema safely
Test on a staging copy before the live site, because a PHP error in functions.php takes the whole site down, not one page. A WebJi® WordPress hosting account gives you a staging clone and SSH access to the files, so the child theme route is available without touching the live theme.
If the markup has to describe a local business, a service list or a product catalogue, the WordPress SEO service builds the schema and the content together. Email support@webji.services with the page URL and the type you want; support answers by email 24/7 in Hindi and English.
Frequently Asked Questions
How do I add schema markup to WordPress without a plugin?
Create a child theme and print a JSON-LD block from functions.php on the wp_head hook, building the object as a PHP array and encoding it with wp_json_encode(). Never edit the parent theme, because the change disappears at the next update.
Which schema type should a WordPress page use?
One primary type per page. Article for posts, WebPage for ordinary pages, Product for a product, LocalBusiness for a location, FAQPage when the page shows questions and answers. Site-wide Organization and WebSite schema go on every page.
How do I test schema markup in WordPress?
Paste the live URL into Google's Rich Results Test, then into the Schema Markup Validator for the full graph. Clear the page cache first, and check Search Console Enhancements after a few days for errors by type.
Why does my site show two Organization schemas?
An SEO plugin already outputs Organization and WebSite, and a hand-written block adds a second one with different details. Keep one source of truth: either configure the plugin or remove the manual block.
Does schema markup guarantee a rich result?
No. Valid markup makes a page eligible; Google decides whether to show the enhancement. Schema that describes content the page does not display, or that fails validation, will not be shown at all.

