惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
博客园_首页
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
B
Blog
D
DataBreaches.Net
腾讯CDC
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
月光博客
月光博客
V
V2EX
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
The Cloudflare Blog
博客园 - 叶小钗
Y
Y Combinator Blog

Example blog

Ghost routing explained with routes.yaml examples — routes, collections & taxonomies Ghost redirects explained with practical redirects.yaml examples How to Serve JSON or XML Data in Ghost How to Change Your Default Post Template in Ghost Ghost Custom Theme Settings How to add Google Fonts to Ghost Themes How to Configure Ghost with Mailgun Ghost Theme Structure & Organization How to Make Custom Templates in Ghost Themes How to Install Ghost CMS via Ghost-CLI How to Add Syntax Highlighting to Ghost The best Ghost CMS hosting platforms Ghost 6.0 — Social Web and Native Ghost Analytics Ghost CMS Social web beta, email 2FA and more author social links How to keep custom design settings when updating your Ghost theme How to use the public preview card in Ghost How to add members-specific sections in Ghost How to customize the default content CTA in Ghost How to build a custom homepage in Ghost An overview of Ghost editor cards and and how they work Ghost CMS News: One-time payments & collecting sales tax How to customize the private site access template in Ghost How to add custom fonts in Ghost themes Ghost CMS News: Additional payment methods & internal linking How to use Code Injection in Ghost How to set meta data of your custom routes & collections in Ghost Ghost CMS News: TK reminders, ActivityPub and improvements How to format dates and use the date helper in Ghost Ghost CMS internationalization, custom fonts & spam protection Understanding and optimizing post and page settings in Ghost CMS
Ghost Snippets: Adding Schema markup in Ghost
Bright Themes · 2023-10-21 · via Example blog

Search engine optimization (SEO) plays a crucial role in achieving higher search rankings and driving organic traffic to websites. One effective strategy to optimize content and enhance search visibility is by utilizing schema markup and structured data.

In this article, we will explore how schema markup and structured data can be added within the Ghost CMS to improve SEO performance.

Schema Markup and Structured Data in Ghost

Schema markup is a code used to provide search engines with additional context regarding the content on web pages. It helps search engines understand the meaning and relationship between different elements of the content.

Structured data, on the other hand, refers to a standardized format used to organize and present data in a structured manner. Structured data is typically implemented using schema markup.

Implementing schema markup and structured data offers several benefits to website owners and content creators. Firstly, it assists search engines in better understanding and interpreting web content, leading to improved visibility and enhanced search rankings. Additionally, structured data allows for rich snippets to be displayed in search engine results pages (SERPs), increasing the likelihood of attracting user attention and click-through rates.

In Ghost you have several options to add schema markup and structured data:

  1. Add the markup code in your Post Code Injection
  2. Add the markup code in an HTML card in the Ghost editor
  3. Add the markup code in your theme code

The above methods can be used for generating structured data markup for different types of content, such as, recipes, events, products, breadcrumbs and more.

When doing it via HTML cards, you can create content snippets and include the same structured data in your posts, just changing the values.

Now let's take a look at some of these schema markup types.

Recipe schema

Schema markup for recipes enables search engines to better understand and display information related to cooking instructions, ingredients, ratings, and more. Here's an example of a recipe schema markup:

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Recipe",
  "name": "Classic Chocolate Chip Cookies",
  "image": "https://example.com/images/cookies.jpg",
  "author": {
    "@type": "Person",
    "name": "John Doe"
  },
  "recipeIngredient": [
    "1 cup butter",
    "1 cup granulated sugar",
    "1 cup brown sugar",
    "2 eggs",
    "2 teaspoons vanilla extract",
    "3 cups all-purpose flour",
    "1 teaspoon baking soda",
    "1 teaspoon salt",
    "2 cups chocolate chips"
  ],
  "recipeInstructions": [
    "Preheat oven to 375°F (190°C) and line baking sheets with parchment paper.",
    "In a large mixing bowl, cream together butter, granulated sugar, and brown sugar.",
    "Add eggs one at a time and stir in vanilla extract.",
    "In a separate bowl, whisk together flour, baking soda, and salt.",
    "Gradually add dry ingredients to the butter mixture.",
    "Stir in chocolate chips.",
    "Drop rounded tablespoons of dough onto prepared baking sheets.",
    "Bake for 8-10 minutes or until golden brown.",
    "Allow cookies to cool for a few minutes before transferring to a wire rack to cool completely."
  ],
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.8",
    "bestRating": "5",
    "ratingCount": "367"
  }
}
</script>

Product schema

Schema markup for products provides detailed information about a specific product, including its name, image, price, availability, and reviews. Here's an example of a product schema markup:

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "Wireless Noise-Canceling Headphones",
  "image": "https://example.com/images/headphones.jpg",
  "description": "Premium wireless headphones with exceptional noise-canceling technology.",
  "brand": {
    "@type": "Brand",
    "name": "Acme Headphones"
  },
  "sku": "AH123456",
  "offers": {
    "@type": "Offer",
    "priceCurrency": "USD",
    "price": "199.99",
    "availability": "https://schema.org/InStock",
    "seller": {
      "@type": "Organization",
      "name": "Acme Electronics"
    }
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.6",
    "bestRating": "5",
    "ratingCount": "128"
  }
}
</script>

Schema markup for breadcrumbs helps search engines understand the structure and hierarchy of web pages within your website. This can improve site navigation and allow search engines to display breadcrumbs in search results. Here's an example of a breadcrumb schema markup:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://example.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Recipes",
      "item": "https://example.com/recipes"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Desserts",
      "item": "https://example.com/recipes/desserts"
    }
  ]
}
</script>

FAQ schema

Schema markup for frequently asked questions (FAQ) helps search engines display question-and-answer content directly in search results. This can increase visibility and provide quick answers to user queries. Here's an example of an FAQ schema markup:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "How long should I bake a cake?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The baking time for a cake depends on the recipe. It is usually mentioned in the recipe instructions. However, as a general guideline, most cakes bake between 25 to 45 minutes."
      }
    },
    {
      "@type": "Question",
      "name": "Can I substitute baking powder for baking soda?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Baking powder and baking soda are not direct substitutes. However, you can use 1 teaspoon of baking powder for 1/4 teaspoon of baking soda, provided there is enough acid in the recipe to activate the baking powder."
      }
    }
  ]
}
</script>

Event schema

Schema markup for events provides structured data related to upcoming events, including the event's name, date, location, and ticket information. This helps search engines display event details prominently, increasing the chances of attracting interested attendees. Here's an example of an event schema markup:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Event",
  "name": "Annual Charity Run",
  "startDate": "2022-07-15T09:00",
  "endDate": "2022-07-15T12:00",
  "location": {
    "@type": "Place",
    "name": "Central Park",
    "address": "123 Main St, New York, NY 10001"
  },
  "offers": {
    "@type": "Offer",
    "url": "https://example.com/charity-run",
    "price": "25",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock",
    "validFrom": "2022-06-01T00:00"
  },
  "performer": {
    "@type": "PerformingGroup",
    "name": "Local Musicians"
  }
}
</script>

Schema markup testing and validation

By testing your schema markup, you can verify that search engines can interpret your structured data correctly, enhancing your chances of obtaining rich search results and improved visibility.

The official Schema.org website offers a Schema Markup Validator allowing you to check the correctness of your schema markup code. Simply input your code or URL, and the validator will analyze your structured data for any errors or inconsistencies.

The Rich Results Test is another tool by Google, specifically designed to test and preview how your structured data might appear in search engine results. It provides a visual representation of your content's appearance and highlights any issues or missing elements related to rich results.


Schema markup and structured data types such as Recipe, Product, Breadcrumbs, FAQ, and Event offer website owners a valuable opportunity to enhance SEO performance and improve search visibility. By implementing these structured data types within your content, you can provide search engines with rich information, leading to higher search rankings, increased user engagement, and improved click-through rates.