WordPress Schema Integration help guide illustration

WordPress Schema Integration

Add Schema.org JSON-LD to WordPress via SEO plugins, theme hooks, or a custom plugin.

GuideIntegrationintermediate15 min readUpdated September 18, 2025

Tags

wordpresspluginsthemescustom-codeseoimplementation

WordPress Schema Integration

WordPress outputs JSON-LD through SEO plugins, theme functions, or a small custom plugin. Pick the path that matches your team's skill level and how much control you need over field mapping.

Option 1: SEO plugin

Plugins such as Yoast SEO and Rank Math generate Organization, Article, and breadcrumb markup automatically.

  1. Install and configure the plugin's schema settings
  2. Set site name, logo, and social profiles in plugin options
  3. Review generated JSON-LD on a sample post and your homepage
  4. Validate with Google Rich Results Test

Use this when default mappings cover your page types. Override or extend when WooCommerce products or custom post types need specific types.

Option 2: Theme hooks

Add JSON-LD in functions.php or a child theme:

add_action('wp_head', function () {
  if (!is_front_page()) return;
  $schema = [
    '@context' => 'https://schema.org',
    '@type' => 'Organization',
    'name' => get_bloginfo('name'),
    'url' => home_url('/'),
  ];
  echo '<script type="application/ld+json">' .
    wp_json_encode($schema, JSON_UNESCAPED_SLASHES) .
    '</script>';
});

Build the array from post meta, ACF fields, or WooCommerce product data. Use wp_json_encode for safe output.

Option 3: Custom plugin

Create a plugin when multiple post types need different schema builders or when you want version-controlled logic separate from the theme.

Common schema types

PageSchema typeKey fields
HomepageOrganizationname, url, logo, sameAs
Blog postArticleheadline, author, datePublished
WooCommerce productProductname, image, offers, sku

Generate field values with the Schema Generator, then wire them to WordPress data.

Checklist before launch

  • Confirm wp_head() exists in your theme
  • Test one URL per template (home, post, product)
  • Resolve plugin conflicts by testing with a default theme
  • Monitor Google Search Console after deploy

See also CMS Integrations for cross-platform workflow steps.

Related Resources