Add schema markup to WordPress without a plugin by placing JSON-LD code in your theme files, a child theme, or a custom code area controlled by your theme. The safest manual method is to add schema to specific templates, such as single posts, product pages, or FAQ pages, rather than pasting the same code sitewide. This keeps your structured data accurate, clean, and easier to test.

TLDR: Use JSON-LD schema, add it to the correct WordPress template, then test it with Google’s Rich Results Test. For example, a local service site with 40 blog posts might add Article schema to posts and LocalBusiness schema to the homepage. If rich results improve click-through rate from 2.1% to 2.8%, that is a 33% lift without changing rankings.

What Schema Markup Does

Schema markup is structured data that helps search engines understand a page. It does not guarantee rich results. It does not replace good content. Still, it can help Google identify your articles, products, reviews, recipes, events, FAQs, and business details with less guesswork.

The preferred format is JSON-LD. It is clean, separate from visible content, and recommended by Google for most use cases. You place it inside a script block in the page source.

Honestly, it feels like many schema plugins make simple jobs messy. They add settings screens, database options, upsells, and extra scripts just to output 20 lines of JSON. If you only need a few schema types, manual setup is often cleaner.

Before You Start

Manual schema is best when you are comfortable editing WordPress files. A small typo can break the markup. A wrong template can place the same schema on pages where it does not belong.

Before editing anything, do these three things:

  • Create a full backup of your WordPress files and database.
  • Use a child theme so theme updates do not erase your work.
  • Test on staging if your host provides a staging site.

You should also decide which schema type fits each page. Do not add every schema type you can find. Use only what matches the visible page content.

Common Schema Types for WordPress

  • Article: Best for blog posts, news posts, and editorial content.
  • FAQPage: Best for pages with visible questions and answers.
  • LocalBusiness: Best for local company homepages or contact pages.
  • Product: Best for product pages with price, stock status, and reviews.
  • BreadcrumbList: Best for showing page hierarchy.
  • Organization: Best for company identity, logo, and official profiles.

Method 1: Add JSON-LD to header.php

This method is simple, but use it with care. Code added to header.php usually appears on every page. That is fine for Organization schema. It is risky for Article, Product, or FAQPage schema because those should appear only on matching pages.

Go to Appearance > Theme File Editor, then open your child theme’s header.php. Add your JSON-LD before the closing </head> tag.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Example Company",
  "url": "https://www.example.com",
  "logo": "https://www.example.com/wp-content/uploads/logo.png"
}
</script>

Save the file. Then view the page source and search for application/ld+json. If you see your code, WordPress is outputting it.

Method 2: Add Schema Only to Blog Posts

This is a better manual method for Article schema. You add the code to single.php or a template part used for single posts. The exact file depends on your theme.

In many themes, you can use WordPress functions to pull the title, date, author, and featured image. That reduces manual editing for each post.

<?php if (is_single()) : ?>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "<?php echo esc_js(get_the_title()); ?>",
  "datePublished": "<?php echo get_the_date('c'); ?>",
  "dateModified": "<?php echo get_the_modified_date('c'); ?>",
  "author": {
    "@type": "Person",
    "name": "<?php echo esc_js(get_the_author()); ?>"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Example Company",
    "logo": {
      "@type": "ImageObject",
      "url": "https://www.example.com/wp-content/uploads/logo.png"
    }
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "<?php echo esc_url(get_permalink()); ?>"
  }
}
</script>
<?php endif; ?>

The catch is that theme files vary. Some themes split templates into several smaller files. Expect to waste time checking whether single.php, content-single.php, or another file controls the final output.

Method 3: Add Schema with functions.php

A cleaner option is to add schema through your child theme’s functions.php. This keeps structured data separate from template markup. It also lets you control where the code appears with WordPress conditional tags.

Here is a basic example for single posts:

function add_manual_article_schema() {
  if (!is_single()) {
    return;
  }
  ?>
  <script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Article",
    "headline": "<?php echo esc_js(get_the_title()); ?>",
    "datePublished": "<?php echo get_the_date('c'); ?>",
    "dateModified": "<?php echo get_the_modified_date('c'); ?>",
    "author": {
      "@type": "Person",
      "name": "<?php echo esc_js(get_the_author()); ?>"
    },
    "url": "<?php echo esc_url(get_permalink()); ?>"
  }
  </script>
  <?php
}
add_action('wp_head', 'add_manual_article_schema');

This adds the schema to the <head> section only on single posts. You can adapt the condition for other content. For example, use is_front_page() for homepage business schema or is_page('faq') for FAQ schema.

Manual FAQ Schema Example

FAQ schema must match visible content on the page. If users cannot see the questions and answers, do not mark them up.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Can I add schema to WordPress without a plugin?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. You can add JSON-LD schema manually through a child theme template or functions.php."
      }
    },
    {
      "@type": "Question",
      "name": "Is JSON-LD better than microdata?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "For most WordPress sites, JSON-LD is easier to manage and is recommended by Google."
      }
    }
  ]
}
</script>

If the FAQ page changes, update the schema at the same time. Outdated FAQ markup can create trust issues and may be ignored by search engines.

How to Test Your Schema

After adding schema, test the URL. Do not rely on the page looking normal. Structured data errors are usually invisible on the front end.

  1. Open Google’s Rich Results Test.
  2. Enter the page URL.
  3. Run the test and review detected items.
  4. Fix errors first, then warnings if they matter.
  5. Check the page again after clearing cache.

Also use Schema.org Validator for a broader structured data check. Google’s tool focuses on rich result eligibility. Schema.org’s tool can reveal general markup problems.

Rich Results Test results preview

Best Practices for Manual Schema

  • Keep schema accurate. Mark up only what appears on the page.
  • Use one clear primary type. A blog post should not pretend to be a product.
  • Avoid fake reviews. Review markup must reflect real user feedback.
  • Use absolute URLs. Include full image, logo, and page URLs.
  • Update dates properly. Modified dates should reflect real content edits.
  • Retest after theme updates. Template changes can remove or duplicate markup.

When Manual Schema Is Not the Best Choice

Manual schema is not ideal for large stores, directories, job boards, or sites with thousands of changing pages. If product prices, stock status, ratings, and events change daily, manual code becomes fragile. One missed update can send wrong data to search engines.

For a small business site, consultant site, brochure site, or controlled blog, manual schema is practical. You get less bloat and more control. You also avoid installing a plugin just to generate simple JSON-LD.

Final Checklist

  • Choose the correct schema type for the page.
  • Add JSON-LD through a child theme or functions.php.
  • Limit schema to the right pages with WordPress conditional tags.
  • Validate with Google’s Rich Results Test.
  • Check for duplicate schema from your theme or SEO plugin.
  • Review schema after content, theme, or URL changes.

The best manual setup is simple: Organization schema on the homepage, Article schema on posts, FAQ schema only on real FAQ pages, and LocalBusiness schema where business details are visible. Keep it accurate, test every change, and resist the urge to mark up content that users cannot actually see.