1

I make articles on specific ingredients and provide their nutrition facts.

On my article page, I have this current schema for the Article type which works perfectly fine from what I know. But I'd like to have another schema that includes the nutrition label on the webpage.

If I can add another schema to the code:

  • Can it be in the same script tag?
  • Which one should be used?
<!-- JSON-LD markup generated by Google Structured Data Markup Helper. -->
<script type="application/ld+json">
{
  "@context" : "http://schema.org",
  "@type" : "Article",
    "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "http://cathscafe.example.com/"
  },
  "name" : "Olive Oil Review - 2019",
  "headline" : "Olive Oil Review",
  "author" : {
    "@type" : "Person",
    "name" : "Christopher Karam"
  },
  "datePublished" : "2019-01-04",
  "dateModified" : "2019-01-04",
  "image" : "https://static1.squarespace.com/static/59a7820e2994ca11766093d3/t/5b00a06f575d1f8e6e07c981/1526767728080/olive-oil-fat-healthy-food-dietary-my-diet-goal-small-hd.jpg",
  "articleSection" : "Wellness",
  "articleBody" : "Olive oil is a liquid fat obtained from olives, a traditional tree crop of the Mediterranean. The oil is produced by cold pressing whole olives...",
  "url" : "https://mydietgoal.com/olive-oil",
  "publisher" : {
    "@type" : "Organization",
    "name" : "MyDietGoal",
    "logo" : { 
    "@type": "ImageObject",
    "name": "MyDietGoalLogo",
   "url" : "https://static1.squarespace.com/static/59a7820e2994ca11766093d3/t/5b6f96c6032be42d1403dd79/1551652043684.jpg",
    "width" : "250",
    "height" : "250"
  }},
  "aggregateRating" : {
    "@type" : "AggregateRating",
    "ratingValue" : "5.0",
    "bestRating" : "5.0",
    "ratingCount" : "6"
  }
}
</script>
1

According to schema.org NutritionInformation is only applicable to menu items or recipes. If you are trying to markup something else you would need to emulate this with all of the required fields.

Putting another object in the same <script> tag would technically be correct, you need to use a JSON array[], though. Neither Google's validator nor Yandex' validator will return any warnings or errors for such a snippet:

<script type="application/ld+json">
[
  {
    "@context" : "http://schema.org",
    "@type" : "Article",
      "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "http://cathscafe.example.com/"
    },
    "name" : "Olive Oil Review - 2019",
    "headline" : "Olive Oil Review",
    "author" : {
      "@type" : "Person",
      "name" : "Christopher Karam"
    },
    "datePublished" : "2019-01-04",
    "dateModified" : "2019-01-04",
    "image" : "https://static1.squarespace.com/static/59a7820e2994ca11766093d3/t/5b00a06f575d1f8e6e07c981/1526767728080/olive-oil-fat-healthy-food-dietary-my-diet-goal-small-hd.jpg",
    "articleSection" : "Wellness",
    "articleBody" : "Olive oil is a liquid fat obtained from olives, a traditional tree crop of the Mediterranean. The oil is produced by cold pressing whole olives...",
    "url" : "https://mydietgoal.com/olive-oil",
    "publisher" : {
      "@type" : "Organization",
      "name" : "MyDietGoal",
      "logo" : { 
      "@type": "ImageObject",
      "name": "MyDietGoalLogo",
     "url" : "https://static1.squarespace.com/static/59a7820e2994ca11766093d3/t/5b6f96c6032be42d1403dd79/1551652043684.jpg",
      "width" : "250",
      "height" : "250"
    }},
    "aggregateRating" : {
      "@type" : "AggregateRating",
      "ratingValue" : "5.0",
      "bestRating" : "5.0",
      "ratingCount" : "6"
    }
  },
  {
    "@context": "http://schema.org",
    "@type": "Recipe",
    "author": "John Smith",
    "cookTime": "PT1H",
    "datePublished": "2009-05-08",
    "description": "This classic banana bread recipe comes from my mom -- the walnuts add a nice texture and flavor to the banana bread.",
    "image": "bananabread.jpg",
    "recipeIngredient": [
      "3 or 4 ripe bananas, smashed",
      "1 egg",
      "3/4 cup of sugar"
    ],
    "interactionStatistic": {
      "@type": "InteractionCounter",
      "interactionType": "http://schema.org/Comment",
      "userInteractionCount": "140"
    },
    "name": "Mom's World Famous Banana Bread",
    "nutrition": {
      "@type": "NutritionInformation",
      "calories": "240 calories",
      "fatContent": "9 grams fat"
    },
    "prepTime": "PT15M",
    "recipeInstructions": "Preheat the oven to 350 degrees. Mix in the ingredients in a bowl. Add the flour last. Pour the mixture into a loaf pan and bake for one hour.",
    "recipeYield": "1 loaf",
    "suitableForDiet": "http://schema.org/LowFatDiet"
  }
]
</script>

If you wish you can put both of them in separate <script> tags, and the result will be the same:

<script type="application/ld+json">
{
  "@context" : "http://schema.org",
  "@type" : "Article",
    "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "http://cathscafe.example.com/"
  },
  "name" : "Olive Oil Review - 2019",
  "headline" : "Olive Oil Review",
  "author" : {
    "@type" : "Person",
    "name" : "Christopher Karam"
  },
  "datePublished" : "2019-01-04",
  "dateModified" : "2019-01-04",
  "image" : "https://static1.squarespace.com/static/59a7820e2994ca11766093d3/t/5b00a06f575d1f8e6e07c981/1526767728080/olive-oil-fat-healthy-food-dietary-my-diet-goal-small-hd.jpg",
  "articleSection" : "Wellness",
  "articleBody" : "Olive oil is a liquid fat obtained from olives, a traditional tree crop of the Mediterranean. The oil is produced by cold pressing whole olives...",
  "url" : "https://mydietgoal.com/olive-oil",
  "publisher" : {
    "@type" : "Organization",
    "name" : "MyDietGoal",
    "logo" : { 
    "@type": "ImageObject",
    "name": "MyDietGoalLogo",
   "url" : "https://static1.squarespace.com/static/59a7820e2994ca11766093d3/t/5b6f96c6032be42d1403dd79/1551652043684.jpg",
    "width" : "250",
    "height" : "250"
  }},
  "aggregateRating" : {
    "@type" : "AggregateRating",
    "ratingValue" : "5.0",
    "bestRating" : "5.0",
    "ratingCount" : "6"
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Recipe",
  "author": "John Smith",
  "cookTime": "PT1H",
  "datePublished": "2009-05-08",
  "description": "This classic banana bread recipe comes from my mom -- the walnuts add a nice texture and flavor to the banana bread.",
  "image": "bananabread.jpg",
  "recipeIngredient": [
    "3 or 4 ripe bananas, smashed",
    "1 egg",
    "3/4 cup of sugar"
  ],
  "interactionStatistic": {
    "@type": "InteractionCounter",
    "interactionType": "http://schema.org/Comment",
    "userInteractionCount": "140"
  },
  "name": "Mom's World Famous Banana Bread",
  "nutrition": {
    "@type": "NutritionInformation",
    "calories": "240 calories",
    "fatContent": "9 grams fat"
  },
  "prepTime": "PT15M",
  "recipeInstructions": "Preheat the oven to 350 degrees. Mix in the ingredients in a bowl. Add the flour last. Pour the mixture into a loaf pan and bake for one hour.",
  "recipeYield": "1 loaf",
  "suitableForDiet": "http://schema.org/LowFatDiet"
}
</script>

You can find more on this here.

  • Do "Detected Warnings" have any impact on the results from Googles' end? – Christopher Karam Mar 4 at 22:38
  • @ChristopherKaram if you're referring to the warnings for the above snippet it's more of a suggestion - I suppose the impact could be that somebody implementing more information than you could benefit. In general, you should always follow the spec unless you have a very good reason not to. – Kuba Serafinowski Mar 4 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.