What schema markup does and why search engines use it
Schema markup is code you add to your website that tells search engines what your content means, not just what words it contains. Without it, a search engine sees "January 15, 2024" and does not know if that is an event date, a publication date, or a price. With schema markup, you label it clearly.
Search engines use schema markup to understand your pages better and show richer results — the kind with star ratings, prices, images, or event dates displayed right in the search listing. This makes your listing more useful to people searching, and it gives you a better chance they will click through.
Schema markup does not change how your page looks to visitors. It is invisible to them. It only changes what information search engines can extract and how they display your page in results.
Key Takeaways
- Schema markup uses a standard language called JSON-LD that you paste into your website's HTML code, usually in the head section or footer.
- The most useful schema types for small websites are Article, LocalBusiness, Product, Event, and Recipe, depending on what you publish.
- Google's Rich Results Test tool shows you whether your schema markup is correct and what rich features your page may display.
- You do not need to add schema to every page — start with your most important content and pages you want to rank for.
- Most website builders and content management systems now include schema markup automatically or offer plugins that add it without coding.
The three ways to add schema markup: which one fits your setup
You have three routes depending on what platform you use. The easiest is to use a plugin or built-in feature. The next is to use a generator tool that writes the code for you. The hardest is to write or edit the code yourself.
If you use WordPress, Wix, Squarespace, or Shopify, check whether your theme or a plugin already includes schema markup. Many do. WordPress plugins like Yoast SEO and Rank Math add schema automatically based on your content type and settings. Wix and Squarespace add basic schema for pages and products without any action from you. Shopify includes product schema on all product pages by default.
If your platform does not include schema, or if you want more control, use Google's Schema Markup Generator or a tool like Merkle's Structured Data Markup Helper. You fill in a form with your information, and the tool generates the code. You then paste that code into your website's HTML.
If you are comfortable editing HTML, you can write schema markup by hand or use a template from schema.org. This gives you the most control but requires you to understand the structure.
How to add schema markup using a plugin (WordPress example)
If you use WordPress, the fastest route is Yoast SEO or Rank Math, both free. Install the plugin from your WordPress dashboard: go to Plugins, click Add New, search for the plugin name, and click Install Now, then set up.
Once activated, the plugin scans your pages and adds basic schema automatically. For a blog post, it marks the title, author, publication date, and featured image. For a product page, it marks the price, availability, and rating if you have reviews.
To customize what schema the plugin adds, open the page or post you want to edit. In the Yoast or Rank Math panel below the editor, look for a Schema section. You can change the content type (Article, Product, Event, and so on), add missing information like author or rating, or remove schema you do not want. Save the page when you are done.
After you save, use Google's Rich Results Test to check whether the schema is correct. Paste your page URL into the tool, and it will show you what schema it found and whether it qualifies for any rich features in search results.
How to add schema markup using a generator tool
If you do not use WordPress or prefer not to install a plugin, Google's Schema Markup Generator is free and requires no account. Go to Google's Structured Data Markup Helper, choose your data type (Article, Event, Product, Local Business, and so on), and paste your page URL or HTML code.
The tool highlights sections of your page and asks you to tag them. For an article, you highlight the headline and tag it as "headline", highlight the author name and tag it as "author", and so on. The tool learns what each piece of information is.
When you are done tagging, click Create HTML and the tool generates a block of code. Copy this code. Open your website's HTML editor (or ask your web host how to access it), find the <head> section or the footer, and paste the code there. Save and publish.
Test the result with Google's Rich Results Test. Paste your page URL, and the tool will show you what schema it found and whether any errors exist.
Which schema types matter most for your content
Article is for blog posts, news stories, and long-form content. It marks the headline, author, publication date, and featured image. Use this if you publish written content.
Product is for anything you sell or review. It marks the name, price, availability, rating, and image. Use this if you have an e-commerce site or product reviews.
LocalBusiness is for a physical location. It marks your business name, address, phone number, hours, and rating. Use this if you have a storefront, office, or service area.
Event is for conferences, classes, concerts, or any scheduled gathering. It marks the event name, date, time, location, and ticket price. Use this if you promote events.
Recipe is for cooking instructions. It marks ingredients, cooking time, yield, and rating. Use this if you publish recipes.
Start with the type that matches your most important content. You do not need to add schema to every page — focus on the ones you want to rank for or that appear most often in search results.
Testing your schema markup and fixing errors
After you add schema markup, always test it with Google's Rich Results Test. Go to the tool, paste your page URL, and click Test URL. The tool crawls your page and reports what schema it found.
If the tool shows green checkmarks, your schema is correct and your page may display rich features in search results. If it shows warnings or errors, the tool tells you what is wrong — for example, a required field is missing, or a date is in the wrong format.
Common errors include dates in the wrong format (use YYYY-MM-DD), missing required fields (like author for an article), or typos in field names. The error message usually tells you exactly what to fix. Go back to your schema code, make the correction, save, and test again.
Note that passing the Rich Results Test does not may provide your page will show rich features in search results. Google also considers other factors like page quality and freshness. But correct schema markup is necessary for rich features to appear at all.
When to add schema and what not to mark up
Add schema to pages you want people to find through search. For a blog, mark up your most popular posts and new posts as you publish them. For an e-commerce site, mark up all product pages. For a local business, mark up your main location page and any service pages.
Do not mark up content that is not accurate or complete. If you mark a product as in stock but it is actually out of stock, or you mark an event date but the event is cancelled, search engines will show incorrect information to people searching. Update your schema whenever the underlying information changes.
Do not use schema to hide information or trick search engines. For example, do not mark text as an article headline if it is actually an advertisement, or mark a price as lower than it really is. Search engines penalize this.
Do not add schema to every single element on your page. Mark the main content — the article headline, the product name, the event date — not every link or sidebar item. This keeps your code clean and makes it easier to maintain.
Frequently Asked Questions
Does schema markup help my page rank higher in search results?
Schema markup does not directly affect ranking. Search engines use it to understand your content better and to decide whether to show rich features like star ratings or prices in your listing. A richer listing may get more clicks, which can indirectly help, but the markup itself does not move you up or down in rankings.
Can I add schema markup to a page I do not own?
No. Schema markup must be in your website's HTML code. You cannot add it to someone else's page. If you want schema on a page you do not control, you would need to contact the page owner and ask them to add it.
What if my website builder does not support schema markup?
Most modern website builders include basic schema automatically. If yours does not, you can use Google's Schema Markup Generator to create the code and paste it into your site's footer or a custom HTML block, if your builder allows it. If your builder does not allow custom HTML at all, consider switching to one that does.
Do I need to add schema markup to my homepage?
A homepage usually does not need schema markup unless it is also a landing page for a specific product, event, or article. If your homepage is just a navigation hub, schema markup will not help. Focus on pages with specific content — articles, products, events, locations.
How long does it take for schema markup to show up in search results?
Search engines can use schema markup when ready after they crawl your page, but it may take days or weeks for Google to re-crawl and index your changes. You can request a crawl using Google Search Console to speed this up. Rich features may appear in search results within a few days after indexing, but there is no may provide.