In today's digital marketing environment, having high-quality content is not enough. How to make search engines better understand and display this content is becoming increasingly crucial.Structured data, especially JSON-LD, is a powerful tool at our disposal, which helps our website present more rich and attractive forms in search results, which is what we often call "Rich Snippets".

AnQiCMS (AnQiCMS) is an enterprise-level content management system developed with Go language as the core, which provides many built-in functions for SEO optimization.It not only supports pseudo-static, Sitemap generation, Robots.txt configuration, but also allows us to flexibly customize the content model.For structured data, Anqi CMS defaults to generating a basic JSON-LD data set for the page.But often, we may need to control and expand these data more finely according to our business characteristics to achieve more competitive search result display.

Understand the core value of JSON-LD

Before delving into customization, let's first briefly review the core value of JSON-LD.It is a lightweight data format that describes page content in a machine-readable way by embedding a JSON code in HTML.For example, an article can describe its title, author, and publication date;A product can describe its price, inventory, and reviews. When a search engine reads these structured data, it can understand the page content more accurately, thereby having the opportunity to display richer visual elements in the search results, such as star ratings, images, price ranges, etc., which can significantly increase click-through rates.

The reason why AnQi CMS can become the preferred tool for small and medium-sized enterprises and content operation teams is that it maintains high flexibility while providing powerful functions.Its template system is based on Go language, the syntax is similar to Django template engine, and it is very easy to get started.This flexibility extends to the management of structured data, allowing us to achieve complex JSON-LD customization through simple template operations.

Integration points of AnQiCMS with JSON-LD

The AnQi CMS handles structured data intelligently when the page is loaded. One of its highlights is that it provides a named{% jsonLd %}The special tag plays a very powerful role: if you use it in the template and write custom JSON-LD code within these tags, AnQi CMS will not simply overwrite the default data, but willautomatically mergeYou define the data and the system generated data. This means that if your custom field conflicts with the default field, your custom content will take precedence;If you add a new field that is not present in the default structure, it will be seamlessly added to the final JSON-LD output.

This merging mechanism brings us great convenience: we do not need to build all structured data from scratch, but only focus on the key information that needs to be customized or supplemented.

Practice: Build Custom JSON-LD in AnQiCMS Template

Now, let's go through specific steps and examples to see how to implement custom JSON-LD structured data in Anqi CMS templates.

Step 1: Identify the content type that needs to be optimized

First, think about what types of content are on your website that need to be better understood by search engines. For example, if you are an e-commerce website, product pages (ProductThe structured data of Schema is crucial; if you are a content blog or news media, the article page (ArticleA Schema) should be paid attention to. The flexible content model function of Anqi CMS can exactly meet your needs to define various content structures such as 'articles', 'products', and 'events.'

Second step: Choose the appropriate JSON-LD Schema type

After determining the content type, the next step is to choose the Schema.org standard that best fits your content description. For example:

  • Article detail page: Usually usedArticleOr its subtypes(NewsArticle,BlogPosting)
  • Product details page: Use.Productand combiningOffer/AggregateRatingetc.
  • Company introduction page: Use.OrganizationorLocalBusiness.

The content model of AnQi CMS allows you to define core content types such as 'articles' and 'products', and even create more custom models.

Third step: use{% jsonLd %}Tag injection of custom data

Assuming we want to implement a more perfectarchive/detail.htmlor custom article templateArticlestructured data in the article detail page of AnQi CMS

  1. Open the corresponding template file:Generally, the template for the article detail page may be located/template/你的模板目录/archive/detail.html. You can find and edit it in the "Template Design" feature in the background.

  2. Insert{% jsonLd %}Tags:in the template file's<head>or<body>section (usually recommended in<head>Insert at the end of the tag{% jsonLd %}Tag pair.

  3. Build JSON-LD content and use AnQiCMS tags for dynamic filling:In{% jsonLd %}Internal, write a JSON-LD syntax compliant `<script`