21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Add Schema Markup in WordPress

Quick answer

To add schema markup in WordPress, either set schema types in one SEO plugin such as Yoast, Rank Math or SEOPress, or print a JSON-LD block on the wp_head hook from a child theme using wp_json_encode(). Mark up only what the page visibly shows, keep one source per type, and validate the live URL in Google's Rich Results Test.

For WordPress site owners and developers adding structured data to posts, pages and WooCommerce products.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
4 min
Sections
8
Updated
14 Nov 2026
Written by
WebJi® team

What does schema markup do on a WordPress site?

Schema markup is structured data, usually JSON-LD in the page head, that tells search engines what a page is about — an article, a local business, a product — in the shared schema.org vocabulary. Valid markup can make a page eligible for rich results; it does not guarantee them or improve rankings by itself.

WordPress core adds almost no schema. Most sites get it from an SEO plugin, a theme, or a small block of code. Use one source per type, because two plugins printing different Organization details confuse more than they help.

Which schema types should a WordPress site use?

Use Organization (or LocalBusiness) and WebSite site-wide, Article on posts, Product on WooCommerce products, and BreadcrumbList for navigation — each only where the page visibly shows those facts. One primary type per page keeps the graph clear.

Common WordPress page types and the schema that fits
PagePrimary typeRich result potential
Home and every pageOrganization or a LocalBusiness subtype, plus WebSiteLogo and knowledge panel signals
Blog postArticle / BlogPostingBetter headline, date and image display
WooCommerce productProduct with OfferPrice, availability and reviews in results
Any page with a trailBreadcrumbListBreadcrumb path instead of URL
Event pageEventEvent listings
Visible Q&A sectionFAQPageLimited: Google shows FAQ rich results mainly for authoritative government and health sites

Google narrowed FAQ rich results and removed HowTo rich results in 2023, so FAQ markup now mainly helps clarity rather than appearance.[2]

How do you add schema with an SEO plugin?

Install one SEO plugin such as Yoast SEO, Rank Math or SEOPress, complete its setup to output Organization and WebSite, set default types for posts and pages, and add specific types on individual pages from the editor sidebar. This is the right route when non-developers edit the site.

  1. Run the plugin's setup wizard and enter the business name, logo and social profiles.
  2. Set posts to Article and pages to WebPage as defaults.
  3. On a key page, open the plugin's schema panel and choose the specific type, for example LocalBusiness on the contact page.
  4. Fill only fields you can verify; wrong values are worse than empty ones.
  5. View page source and search for application/ld+json to confirm output.

How do you add JSON-LD without a plugin?

Print a JSON-LD script on the wp_head hook from a child theme's functions.php or a code-snippets plugin, building the data as a PHP array and encoding it with wp_json_encode(). Never edit the parent theme; updates overwrite it.

<?php
add_action( 'wp_head', function () {
    if ( ! is_page( 42 ) ) { // only on the page with ID 42
        return;
    }
    $data = array(
        '@context'  => 'https://schema.org',
        '@type'     => 'LocalBusiness',
        'name'      => 'Example Salon',
        'telephone' => '+91-141-0000000',
        'url'       => home_url( '/' ),
        'address'   => array(
            '@type'           => 'PostalAddress',
            'streetAddress'   => 'Shop 1, Example Road',
            'addressLocality' => 'Jaipur',
            'addressRegion'   => 'Rajasthan',
            'postalCode'      => '302021',
            'addressCountry'  => 'IN',
        ),
    );
    echo '<script type="application/ld+json">' . wp_json_encode( $data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) . "</script>\n";
} );

Target pages by ID with is_page( 42 ), a post type with is_singular( 'product' ), or a template with is_page_template( 'page-contact.php' ). If your SEO plugin already prints LocalBusiness, disable that output or skip this snippet.

How do you test schema markup in WordPress?

Clear the cache, run the live URL through Google's Rich Results Test, check the full graph in the Schema Markup Validator, then watch Search Console's enhancement reports for a few days. A cached old page is the most common reason a fix seems not to work.

  1. Purge the page cache and any CDN cache for the URL.
  2. Rich Results Test: fix every error before looking at warnings.
  3. Schema Markup Validator (validator.schema.org): confirm there is one Organization and no duplicate types.
  4. Search Console: review the relevant enhancement report after Google recrawls.

What schema errors do WordPress sites usually hit?

Most problems are duplicates from two sources, broken JSON from hand-typed strings, caches serving old HTML, and markup describing content no longer on the page. Each has a direct fix.

Common WordPress schema errors and fixes
SymptomCauseFix
Two Organization nodes with different namesPlugin plus theme or manual blockKeep one source; turn off the other
JSON parse errorUnescaped quotes, or a PHP notice printed inside the scriptBuild arrays and use wp_json_encode(); fix the notice
Markup in source but not in the testPage or CDN cachePurge, then re-test
Mismatch warnings for FAQs or ratingsSchema lists content the page no longer showsMake markup follow the visible page
Product missing priceVariable product with no default variation priceSet prices on variations; let WooCommerce output Offer data

Google's rule is simple: mark up only content visible to users.[1]

Where should you test schema changes safely?

Test code changes on a staging copy first, because a PHP error in functions.php can take down the whole site. A WordPress staging site lets you check the output before going live.

WebJi® WordPress hosting supports staging and file access for the child-theme route. If you want schema planned with the content, the WordPress SEO service covers both; email support@webji.services with the URL and type you need.

Sources

  1. Google Search Central, General structured data guidelines.
  2. Google Search Central Blog, Changes to HowTo and FAQ rich results (August 2023).
FAQ

Frequently asked questions

Does schema markup improve Google rankings?

Not directly. It helps search engines understand the page and can make it eligible for rich results, which may improve click-through. Content quality and links still decide rankings.

Can I use two SEO plugins for schema?

Avoid it. Two plugins usually print overlapping Organization, WebSite and Article nodes with different details. Choose one plugin for SEO and schema, and switch off schema output in any other plugin or theme.

Does WooCommerce add Product schema automatically?

Yes, WooCommerce outputs basic Product and Offer data for product pages, and SEO plugins can extend it. Check one simple and one variable product in the Rich Results Test, because variable products often miss price data.

Is it worth adding FAQPage markup now?

For most business sites it no longer produces a visible FAQ rich result, but it is harmless when the questions are visible and can help other systems read the page. Do not add hidden questions just for markup.

Checked against Google Search Central on 15 November 2026 · Reviewed by the WebJi® team, Jaipur.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.