When a WordPress site starts appearing in search results, the listings often look bare. Just a title and a meta description — no extra detail, no rich features. That’s how most sites start, and it’s completely normal.
Schema markup is what changes that. It gives Google structured signals about your content — what type of page it is, who wrote it, what it’s about — which can improve how your listings appear in search. It won’t transform rankings on its own, but it supports the SEO work you’ve already done by helping search engines interpret your content more accurately.
On most sites I build, I add schema once the structure and content are solid. It’s not a day-one task, but it’s worth doing properly once you’re ready.
What Schema Markup Does
Schema is structured data added to your pages in a format called JSON-LD. It sits in the <head> of your HTML and tells search engines things your content alone can’t — that a post is an article, who the author is, when it was published, what the site represents.
When this information is present and accurate, Google can use it to enable rich results: things like article metadata, breadcrumb paths, or FAQ entries appearing directly in search listings. It doesn’t guarantee rich results, but it makes your pages eligible for them.
Two Ways to Add Schema in WordPress
There are two main approaches: using an SEO plugin, or adding schema directly via your theme’s functions.php file.
Using an SEO Plugin
If your site uses Rank Math or Yoast SEO, both plugins handle basic schema automatically. Rank Math gives more control — you can set a default schema type for all posts, then customise individual posts with specific types like Article, HowTo, or FAQ through the Schema Generator panel in the post editor.
Yoast handles Organisation, Website, and Breadcrumb schema by default, but offers less flexibility for post-level customisation.
For most WordPress sites using either of these plugins, enabling schema involves:
- Checking the plugin’s Schema settings (in Rank Math: Dashboard → Schema module; in Yoast: it’s active by default)
- Setting a default schema type for posts — Article is correct for most content sites
- Using the Schema Generator for individual posts where a more specific type applies, such as HowTo for tutorials or FAQ where visible question-and-answer content exists
Adding Schema via functions.php (No Plugin Required)
If your site doesn’t use an SEO plugin, or you want full control without plugin overhead, you can output schema directly from your theme’s functions.php file using wp_head.
This approach outputs schema as JSON-LD injected into the page head — clean, lightweight, and not dependent on a third-party plugin to stay updated.
Here is a basic Article schema block for WordPress posts:
function veravix_article_schema() {
if ( is_single() ) {
global $post;
$schema = array(
'@context' => 'https://schema.org',
'@type' => 'Article',
'headline' => get_the_title(),
'datePublished' => get_the_date( 'c' ),
'dateModified' => get_the_modified_date( 'c' ),
'author' => array(
'@type' => 'Person',
'name' => get_the_author_meta( 'display_name', $post->post_author ),
),
);
echo '<script type="application/ld+json">' . wp_json_encode( $schema ) . '</script>';
}
}
add_action( 'wp_head', 'veravix_article_schema' );
You can extend this with a publisher object for your site name and logo, or add a WebSite schema block for the homepage. Keep each schema type in a separate function so they’re easy to maintain.
For a WebSite schema on the homepage:
function veravix_website_schema() {
if ( is_front_page() ) {
$schema = array(
'@context' => 'https://schema.org',
'@type' => 'WebSite',
'name' => get_bloginfo( 'name' ),
'url' => home_url(),
);
echo '<script type="application/ld+json">' . wp_json_encode( $schema ) . '</script>';
}
}
add_action( 'wp_head', 'veravix_website_schema' );
Practical Tips
Match the schema type to the content. Article for posts, WebSite for the homepage. Don’t add HowTo or FAQ schema unless the page visibly contains that content — schema that doesn’t reflect what’s on the page can create validation errors or be ignored entirely.
Validate before you consider it done. Google’s Rich Results Test (search.google.com/test/rich-results) shows what schema Google detects on a given page and flags any errors. Run it after publishing or after making changes.
Use FAQ schema selectively. Adding FAQ schema to every post dilutes its usefulness. I only add it when a post has a genuine question-and-answer section that adds value for the reader — not as an SEO tactic bolted on after the fact.
Don’t expect immediate changes. Schema won’t move rankings or produce rich results the moment it’s added. Google needs to recrawl the page and assess the markup before anything changes in search listings.
Common Mistakes
Adding schema types that don’t reflect the page content is the most common error — for example, applying Review schema to a post that contains no actual review. Search engines cross-reference the markup against what’s on the page.
Putting schema on every page without checking what’s already there is another one. If you’re adding functions.php code to an existing plugin-managed site, duplicate schema blocks can cause conflicts or confuse validation tools.
Ignoring validation errors is also common. Even minor formatting issues in the JSON-LD output can prevent rich results from appearing.
When a Plugin vs Custom Code Makes More Sense
If your site already uses Rank Math or Yoast and you’re comfortable with those tools, adding schema through the plugin is the simpler path — especially if you want to manage schema per-post through the editor UI.
If your site has no SEO plugin, or you want tight control without plugin dependencies, the functions.php approach is cleaner. It produces the same JSON-LD output without adding plugin overhead or relying on a third party to keep the format updated.
Google’s own guidance on how structured data works is worth reading if you want to understand what’s eligible for rich results and how they’re evaluated: Understand how structured data works.
Once your schema is in place, the rest of your basic SEO setup for WordPress — titles, descriptions, sitemap — works alongside it to give search engines a complete picture of your site.
Conclusion
Schema markup gives search engines structured information about your content that they can’t reliably extract from the page text alone. In WordPress, you can add it through an SEO plugin or directly via functions.php. Either way, keep it accurate, validate it, and match the schema type to what the page actually contains.

Etienne Basson works with website systems, SEO-driven site architecture, and technical implementation. He writes practical guides on building, structuring, and optimizing websites for long-term growth.