How to Add Schema.org JSON-LD to WordPress? (Rank Math + Code)
Adding Schema markup to your WordPress site makes it easier for Google to understand your content. Automatic with Rank Math, full control with custom code. I'll show you how to use both together.

# DON'T WRITE
Have you ever thought about what Google's bots see when they crawl your site? For a human, "Price: 299 TL" is clear information, but for a bot it's just text. Schema.org markup labels this text as "This is a product, its price is 299 TL, it's in stock" and makes it understandable to bots. When I first dealt with Schema in 2019, I was using Yoast SEO, then I switched to Rank Math. When I founded FUTIA in 2023, I started writing custom Schema code because there were situations in client projects that Rank Math didn't cover. In this post, I'll explain both how to use Rank Math's automatic Schema features and how to add custom JSON-LD code, and which one you should use in which situations. I'll share what I learned while adding Recipe Schema to 618 recipe pages for italyanmutfagi.com, and the problems I encountered while writing Person/MedicalBusiness Schema for 79,000 doctor profiles on doktorbul.com.
What is Schema.org and Why Should You Add It to Your WordPress Site?
Schema.org is a structured data standard created jointly by Google, Microsoft, Yandex, and other search engines in 2011. Simply put: thanks to special tags you add to your site's HTML, search engines can better categorize your content. For example, if you mark "author name," "publication date," and "category" information for a blog post with Schema, Google can display this post as a rich snippet in search results. Extra information like star ratings, author photo, and publication date increases user click-through rate.
There are two main ways to add Schema in the WordPress ecosystem: SEO plugins (Rank Math, Yoast, SEOPress) or custom code. I generally use both together in FUTIA projects. Rank Math automatically generates basic Schema types (Article, Product, FAQ, HowTo), but custom code is essential for special cases. For example, on diolivo.com.tr, Rank Math handled the breadcrumb Schema for e-commerce categories, but I had to write custom Offer Schema for cart recovery pages.
Let me also state a fact: adding Schema alone won't boost your rankings. Google officially says this. But rich snippets increase click-through rate, which indirectly contributes to SEO. When I added JobPosting Schema to job listing pages on memuratamalari.com, rankings didn't change, but we started getting listed on Google Jobs and traffic increased by 18%.
Adding Automatic Schema Markup with Rank Math
Rank Math is one of WordPress's most powerful SEO plugins and offers 15+ Schema types even in its free version. Installation is simple: from the WordPress admin panel, go to "Plugins > Add New," type "Rank Math," and install it. The setup wizard guides you step by step. I usually start in "Easy" mode, then switch to "Advanced" mode if needed.
Default Schema Settings in Rank Math
In Rank Math > General Settings > Schema section, you select your site's global Schema type. For most blogs, "Organization" or "Person" is appropriate. I chose "Organization" for the FUTIA blog, added the logo URL, and connected social media profiles. This information is automatically added to every page's Schema.
In the post editor (Gutenberg or Classic Editor), you'll see the Rank Math meta box on the right side. When you click the "Schema" tab, you can choose which Schema type you want to use for that page. For blog posts, "Article" usually comes automatically, for product pages you select "Product," for recipe pages you select "Recipe."
Example: I used Recipe Schema for every recipe page on italyanmutfagi.com. After selecting Recipe in Rank Math, I filled in these fields:
- Recipe Name: Page title (automatic)
- Description: Meta description (automatic)
- Cook Time: 30 minutes
- Prep Time: 15 minutes
- Calories: 350 kcal
- Recipe Ingredients: Ingredient list (pulled from ACF)
- Recipe Instructions: Step-by-step instructions
After filling in this information, Rank Math automatically adds the Schema code in JSON-LD format to the page's
section. You can see that the Recipe markup is recognized in the "Enhancements" report in Google Search Console.Rank Math's Limitations and the Need for Custom Code
Rank Math is great but doesn't cover every situation. For example:
- Multilingual sites: If you're using WPML or Polylang, you may need separate Schema editing for each language
- Custom content types: If you have custom post types (e.g., "Doctor Profile"), Rank Math's default templates fall short
- API integrations: On doktorbul.com, I was pulling doctor information from an external API; manually entering this data into Rank Math was impossible
- Advanced Schema types: Niche types like MedicalBusiness, EducationalOrganization, SoftwareApplication aren't in Rank Math
In these cases, you need to write custom JSON-LD code. I generally use Rank Math on basic pages (homepage, about, blog posts) and add custom code for special pages.
How to Add Custom JSON-LD Code to WordPress?
JSON-LD (JavaScript Object Notation for Linked Data) is the cleanest format for Schema markup. It doesn't mix with HTML; it's added to
or with a