Blog
Wild & Free Tools

Add Schema Markup to WordPress Without a Plugin (No Yoast, No Rank Math)

Last updated: April 2026 9 min read

Table of Contents

  1. Why skip the plugin
  2. Method 1: Custom HTML block
  3. Method 2: Theme functions.php
  4. Method 3: Page templates
  5. Validating the schema
  6. When to add a plugin
  7. Frequently Asked Questions

You can add schema markup to WordPress without installing Yoast, Rank Math, or any other SEO plugin. Plugins are convenient but they bloat your site, slow page loads, and lock you into their schema patterns. Hand-coded schema is faster, lighter, and gives you full control. This guide walks through three plugin-free methods, from quickest to most scalable.

Why You Might Skip the Plugin in the First Place

Yoast SEO and Rank Math are great for sites that need schema across hundreds of posts. But for many sites, the trade-off isn't worth it:

If you have under 50 posts, or you only need schema on a few key pages, plugin-free is faster. If you have hundreds or thousands of posts and you're not a developer, a plugin is probably the right call. Pick based on scale.

Method 1: Paste Schema Into a Custom HTML Block (Easiest)

This is the fastest method. Works for any single post or page.

  1. Open your post in the Gutenberg editor
  2. Click the + button to add a new block, search for "Custom HTML"
  3. Use our free schema markup generator to build your JSON-LD code
  4. Copy the entire script tag (including the opening and closing script tags)
  5. Paste it into the Custom HTML block
  6. Click "Update" to save the post

Done. The schema is now in your post. View the published page source to confirm — search for "application/ld+json" and you should see your code.

This method is perfect for one-off pages: your homepage with LocalBusiness schema, your services page with Service schema, a few cornerstone blog posts with FAQ or HowTo schema. For 1-10 pages, this is faster than configuring a plugin.

Method 2: Inject Schema via functions.php (Site-Wide)

For schema you want on every page (or every post of a certain type), inject it via your theme's functions.php — but use a CHILD theme so updates don't wipe your code.

Create a child theme if you don't have one. In the child theme's functions.php, add a function hooked into wp_head:

function custom_schema_markup() {
  if (is_singular('post')) {
    global $post;
    $schema = array(
      "@context" => "https://schema.org",
      "@type" => "BlogPosting",
      "headline" => get_the_title($post),
      "datePublished" => get_the_date('c', $post),
      "dateModified" => get_the_modified_date('c', $post),
      "author" => array(
        "@type" => "Person",
        "name" => get_the_author_meta('display_name', $post->post_author)
      ),
      "image" => get_the_post_thumbnail_url($post, 'full')
    );
    echo '<script type="application/ld+json">' . wp_json_encode($schema) . '</script>';
  }
}
add_action('wp_head', 'custom_schema_markup');

This outputs Article schema on every single post automatically, pulling the title, date, author, and featured image from WordPress. Customize the schema array to match what you need. For pages instead of posts, change is_singular('post') to is_singular('page').

Sell Custom Apparel — We Handle Printing & Free Shipping

Method 3: Custom Page Templates for Specific Page Types

If you have specific page types that need different schema (e.g., your services page needs Service schema, your locations need LocalBusiness, your products need Product), create custom page templates in your child theme.

In your child theme folder, create a file like services-page.php with this header at the top:

<?php
/* Template Name: Services Page */
get_header();
?>

Below the header, add your normal page content output, plus a script tag with the JSON-LD for that page type. When you create a new page in WordPress, you can pick this template from the Page Attributes panel — it'll use your custom schema.

This method scales well for sites with several distinct page types. Build a template per type, assign as needed. No plugin, no per-page manual work.

Validating Your Schema After Adding It

Whichever method you use, always validate after deploying. Two tools:

Paste your published page URL into both. If both pass, you're good. If one fails, the error message will tell you what to fix.

After validating, add your site to Google Search Console and watch the Enhancements section. Google reports any schema issues it finds during normal crawling — much more comprehensive than one-off validation.

When You Should Just Use a Plugin

Plugin-free has limits. Use a plugin if:

Yoast and Rank Math both handle this well. The tradeoff is page weight and reduced flexibility. For most sites with content teams, that tradeoff is worth it. For developer-managed sites with limited but high-value pages, plugin-free wins.

Try It Free — No Signup Required

Runs 100% in your browser. No data is collected, stored, or sent anywhere.

Open Free Schema Markup Generator

Frequently Asked Questions

Is plugin-free schema actually better for SEO?

Not better in terms of schema correctness — Google parses both the same way. Better in terms of page speed (no plugin bloat) and customization control. For sites where page speed matters or where you need non-standard schema, plugin-free wins. For high-volume content sites, plugins are more practical.

Can I have both Yoast and custom schema?

You can, but be careful about duplication. If Yoast outputs Article schema and your custom code also outputs Article schema, Google sees two conflicting blocks. Either disable Yoast's schema for the page types you're handling manually, or augment Yoast's schema with your custom additions instead of replacing.

Do I need to use a child theme?

Yes if you're editing functions.php. Without a child theme, your changes get wiped every time the parent theme updates. Creating a child theme takes about 10 minutes and protects your customizations forever.

Will Custom HTML block schema break if I use a different theme?

No. Custom HTML blocks are part of post content, stored in the database. They survive theme changes. The schema lives with the post, not the theme. This is one of the advantages of Method 1.

Can I add multiple schema types to one page?

Yes. You can have multiple separate script blocks on a page (one for Article, one for FAQ, one for Breadcrumb), or you can combine them in a single script block with @graph. Both work. Google parses all schema on the page.

How do I edit Shopify schema without a plugin?

Shopify uses Liquid templates. Edit theme.liquid or specific template files (product.liquid, collection.liquid) and paste your schema JSON-LD into a script tag. See our Shopify schema guide for the full pattern.

Launch Your Own Clothing Brand — No Inventory, No Risk