- Notifications
You must be signed in to change notification settings - Fork75
Collection of structured data snippets in Google preferred JSON-LD format.
JayHoltslander/Structured-Data-JSON-LD
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Structured Data is hard when you're starting out. Conflicting info. Old outdated information. Poor documentation. I've spent a significant amout of time trying to master it. Now you can benefit from all my hard work and testing. Everything here works properly or it wouldn't be here. Many of these will provide thefancy Google Search Enhancements you desire and ensure your content types are marked up properly.
Aug 15th 2022 (View)
Google has added a clarification in its product structured data documentation around GTIN usage.Read more!Dec 15th 2020 (View)
Google provides an update on their Structured Data Testing Tool's future. (Saved!)Read more!May 25th 2020 (View)
Tony McCreath has created a very cool tool to visualize structured data at any given URL. Simply enter a URL by clicking the "Fetch from URL" button and behold.Try it out!Apr 6th 2020 (View)
Google has released documentation to guide the implementation of structured data via JavaScript, whether by using Google Tag Manager with JSON-LD or custom JS.Read more.Sept 13th 2019 (View)
Google's John Mueller clarified on the September 11 edition of #AskGoogleWebmasters that JSON structured data can be inserted in the head as well as the body of your pages.Read more.Apr 16th 2019 (View)
Yoast adds drastically enhanced Structured Data support to Wordpress with their latest version of their plugin.Read more.Feb 25th 2019 (View)
Another uproar hits the web after SEJ posts that Google has declaredStructured Data shouldn't be inserted via Google Tag Manager. While it's tough to argue against such a reputable source, I'd like to point out that one important quote was omitted in the article from the discussion. "Whileyou can use GTM to add SD to pages, and some people do, it's more complex and brittle." The article also pointed to the fact that the Structured Data testing tool can't see SD that's been inserted onto a page by GTM as proof that it's not meant to be done. But this is a fairly well known issue that is worked around by inserting it via Javascript (See below).I've asked @JohnMu to elaborate or affirm but he never seems to address these challenging questions directly. Orhe's cryptic about it. John is always cited as the guy who is saying GTM insertion shouldn't be done, but he's also a guy who knows that it can be done successfully.Jul 13th 2018 (View)
Google's Structured Data Testing Tool has stopped seeing Structured Data thats been inserted via Google Tag Manager. This caused a minor little uproar on Twitter when Google's John Mueller tweeted a response of "I wouldn't rely on a tool like GTM to add Structured Data". One blog immediatelytwisted this into wrote that Google itself has now declared that GTM should not be used for inserting Structured Data. Whichis ridiculous. A new way to insert Structured Data via Google Tag Manager has been found bySimo Ahava and this method allows for the testing tool to detect the Structured Data 100% fine.This tool by Saijo George can help you generate the Google Tag Manager friendly version of your JSON-LD code.
Total newb to all this? Seethis great beginner's guide on Moz
A.) Hand code it in (Learn more)
Ugh! This is not easily maintainable at scale.
Although the Structured Data CAN be placed in the head and work properly,Google's examples show it being placed in the body immediately after the opening body tag. Their CodeLabshows it in the head though.
Google's John Mueller clarified on the September 11 edition of #AskGoogleWebmasters that JSON structured data can be inserted in the head as well as the body of your pages.Read more
B.) Use Google Tag Manager (Learn more)
UseGoogle Tag Manager to insert the code with the "Custom HTML" tag. (See screenshot below.) Why Tag Manager? Because Tag Manager can dynamically change the Structured Data based on the content of the page! (eg: Blog posts) Seethis article andthis older Moz article for more information on how to do that.
UPDATE: Google changed something. Now, in order to have the Structured Data Testing tool detect inserted Structured Data properly, it must be inserted programatically. Pasting your desired Structured Data within this snippet below will allow it to be detected properly by the testing tool.
<!-- GOOGLE TAG MANAGER VERSION --><!-- Credit: https://twitter.com/SimoAhava/status/1001397355403468802 --><!-- Source: https://github.com/JayHoltslander/Structured-Data-JSON-LD --><script>(function(){varjsonData=// PASTE THE JSON THAT YOU WANT TO USE, HERE.// Only paste what's within the <script> block.// Your pasted content should start with a { and end with a };varel=document.createElement('script');el.type='application/ld+json';el.innerHTML=JSON.stringify(jsonData);document.head.appendChild(el);})();</script>
See also:
- How to install Google Tag Manager
- Add schema markup site using Google Tag Manager
- Adding JSON-LD structured data with Google Tag Manager
| 🔍Screenshot |
C.) Use a Wordpress plugin (Learn more)
An average rating based on multiple ratings or reviews utilizing theAggregateRating schema. Be sure to readthis article to see why using this example as written might not be the best idea. Hmm. 🤔 Also note that using a 3rd party's ratings (like say Google or Yelp) for alocalBusinessseems to goagainst Google's guidelines. BUT, also seethis note on using 3rd party reviews.

If you’re a publisher website, the more specific schema types likeNewsArticle orBlogPosting are recommended (choose one or the other, depending on your site/content). Leveraging these markups accordingly can help your content to appear in Google News and in-depth articles search suggestions. See:Enabling Rich Snippets for Articles.Note: To show up in Google's News Carousel not only will the page require Structured Data but it's alsorequired to be a valid AMP page. If you are using theofficial AMP Plugin for Wordpress you will definitely want to use Tag Manager to insert your Structured Data as opposed to other methods since you will be able todynamically generate Schema.org JSON-LD Tags from pages that contain the correct pattern for your posts.eg:?amp=1 or/amp

An even more specific version of Article for a blog post. See theBlogPosting schema for more info.

TheBreadcrumbList schema allows you to mark up the breadcrumbs on your site to generate breadcrumb rich snippets for your pages in the SERPs.Learn more.

TheCourse schema allows you to mark up courses on your site to generate rich snippets for your courses in the SERPs.Learn more.



TheDataset schema is for a body of structured information describing some topic(s) of interest. It should use the sameAs property to link to the canonical page.Learn more.

TheFAQPage schema is different than Q&A and is (obviously) for a FAQ page. A Frequently Asked Question (FAQ) page contains a list of questions and answers pertaining to a particular topic. Properly marked up FAQ pages may be eligible to have a rich result on Search and Markup Action for the Google Assistant, which can help your site reach the right users.Learn more.



TheFAQPage schema is used to explicitly tell Google that your content is a how-to. A how-to walks users through a set of steps to successfully complete a task, and can feature video, images, and text. For example, “How to tie a tie” or “How to tile a kitchen backsplash”. If each step in your how-to must be read in sequence, it's a good sign that HowTo structured data could benefit your content.Learn more.



An example of theImageObject schema. Demonstrates use of theexifData schema.

TheItemList schema makes a page's items eligible for theCarousel Feature on mobile devices (Screenshot). This example is for a summary page which has a short description of each item in the list, and each item points to a separate details page that is focused entirely on one item. The details page is where the more detailed Structured Data on the item would be located. See: Docshttps://developers.google.com/search/docs/guides/mark-up-listings#summary-page--multiple-full-details-pages

TheItemList schema makes a page's items eligible for theCarousel Feature on mobile devices (Screenshot). This example is for a single, all-in-one-page list hosts all list information, including full text of each item: for example, a gallery of recipes for various kinds of muffins, all contained on one page.See: Docshttps://developers.google.com/search/docs/guides/mark-up-listings#single-all-in-one-page-list

TheItemList schema makes a page's items eligible for theCarousel Feature on mobile devices (Screenshot). This example shows usage with theCollectionPage schema.

This example shows possible usage for an ecommerce category page withProduct schema items listed within it. Thisis valid schema however Google has stated that the Product schema is for use on "a product page that describes a single product" A Google documentation writer hadthis to say when asked about this exact snippet/use-case.

Another example of a list similiar to the example above but laid out differently.

Adding structured data makes your job postings eligible to appear in a special user experience in Google Search results leading to increased chances of discovery and conversion. Your postings are eligible to be displayed more prominently in the dedicated Job Search UI, featuring your logo, reviews, ratings, and job details. The new user experience enables job seekers to filter by various criteria like location or job title, meaning you’re more likely to attract applicants who are looking exactly for that job.Learn more.

An example of a LocalBusiness with multiple locations defined. Each location having it's own defined service areas.

An example of a LocalBusiness customized for a law firm. Demonstrates combined @types (LocalBusiness/Organization/LegalService) andCorporate Contact useage.

A detailed example of a complex LocalBusiness customized for a Notary. Demonstrates combined @types (LocalBusiness/Organization/Notary) andCorporate Contact useage.

An example of a LocalBusiness customized for an online store with no physical location. Demonstrates combined @types (LocalBusiness/Organization/Store)

TheMovie schema in JSON-LD format. Mark up your movie lists with structured data so users can explore movies through Google Search. You can provide details about the movies, such as the title of the movie, director of the movie, and an image of the movie. The movie carousel is only available on mobile devices.Learn more

My personal structured data snippet for "Person" in JSON-LD format.

TheProduct schema in JSON-LD format. There are two types of pages where you would typically use this markup: a product page that describes a single product, or a shopping aggregator page that lists a single product, along with information about different sellers offering that product. Don't use this schema on a page that contains many products like a category page.Learn more



An example of some markup that results in Rich Snippets for Questions as observed in the wild being used onStack Exchange websites.SERP Screenshot This example includes additional Schema types for "Answer" and "QAPage" which do not seem to be required but complement each other.

TheRecipe schema can result in Rich Snippets for Recipes.Learn more.



A collection of services that a LocalBusiness may provide with per/service ratings.


How to define a service area for a local business.

TheSiteNavigationElement schema can help increase search engines’ understanding of your site structure and navigation and can be used to influence organic sitelinks. (See also WPHeader on this page for an example of usage within a Navbar!)

For Voice search a SpeakableSpecification indicates via css selector(s) sections of a document that are highlighted as particularly speakable. Seethis article for more info.

TheWebSite schema markup helps generate the Sitelinks Search Box feature for brand SERPs and can help your site name to appear in search results. You must, of course, have an existing site search on your website to enable the Sitelinks Search Box element.
Includes:
- theWebpage schema. Why both? Seethis description.)
- WPHeader
- WPSidebar
- WPFooter


("Webpage Header" not "Wordpress Header") Define structured Data for items within a site's header with theWPHeader schema. Includes SiteNavigationElements within! Also see an example of this in use within the snippetWebSite.json

A site with embedded or hosted video content can leverage the VideoObject schema. Google primarily displays video rich snippets for YouTube videos, but this will help video rich snippets to appear for your Web pages in Google Video Search. Google Resource Page:Enabling Rich Snippets for Videos

Indicates where something should be viewed. One of the most common implementations is in Google App indexing, where it enables a URL from a website indexed in search results, to be opened inside the corresponding App (if installed in the user's device).

You can link snippets together and reuse them (DRY) by defining and referencing their@id (These are called "Node identifiers") Learn more about themhere.
View
SiteNavigationElement- Table (Examples)
- WPAdBlock (Examples)
ProductWebsiteArticle- Report (Examples)
CourseDataset- GeoShape (Examples)
- Structured-Data-Test-Button Wordpress Plugin
- Yoast's admin bar functions
- The GoogleStructured Data Test Tool.
- Content mismatch? Missing Schema on AMP pages -https://www.searchenginejournal.com/structured-data-amp/323523/
- FAQ, HowTo, and Q&A: Using New Schema Types to Create Interactive Rich Results -https://moz.com/blog/new-schema-types-to-create-interactive-rich-results
- Schema Markup Structured Data 2018 Guide -https://presencemedia.io/schema-markup-structured-data-2018-guide/
- Good instructions -https://builtvisible.com/micro-data-schema-org-guide-generating-rich-snippets/
- Using Google Tag Manager to dynamically generate Schema.org JSON-LD Tags
- 5 Common schema problems and what to do about them
- Implement JSON-LD within the Wordpress Divi theme
- Structured Data Actions in email
- Yoast's "Ultimate Guide"
- Reference - Local Business -http://linter.structured-data.org/examples/schema.org/LocalBusiness/
- Reference - Corporate Contacts -https://developers.google.com/search/docs/data-types/corporate-contacts
- Reference - Contact point -http://linter.structured-data.org/examples/schema.org/ContactPoint/
- Homepage Structured Data
- Steal our JSON-LD
About
Collection of structured data snippets in Google preferred JSON-LD format.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.