In today's highly competitive online environment, making a website's content stand out on search engine results pages (SERP) and attract more target users is the goal of every website operator.In addition to keyword optimization, high-quality content, and a good user experience, using structured data (JSON-LD) to 'tell' search engines exactly what your content is becoming the key to improving website visibility and obtaining rich search results (Rich Snippets).AnQi CMS as a SEO-friendly content management system has provided us with powerful JSON-LD support features, making this process particularly efficient and convenient.

Why is structured data (JSON-LD) so important?

Imagine when a user searches for a specific topic in a search engine, if your website's search results not only display titles and descriptions but also show star ratings, product prices, author information, publication dates, even common questions and their answers, it would undoubtedly greatly increase click-through rates.These rich results are achieved through structured data.

JSON-LD (JavaScript Object Notation for Linked Data) is a lightweight linked data format based on JSON.It allows us to embed descriptive information in web pages, helping search engines to understand the content more accurately, such as identifying the title, author, publication time of a blog post, the name, price, stock of a product, or the address and business hours of a local business.This clear semantic information allows search engines to display your content in a more rich and attractive way, thereby enhancing the competitiveness of your website in search results.

How to simplify JSON-LD deployment with AnQi CMS

AnQi CMS has always fully considered SEO requirements from the beginning of its design, and built-in structured data functions.When you enable structured data support in the background, the system will automatically insert a basic JSON-LD code block on the page, usually containing basic information about the current page, such as page type (such as "web page" or "article"), title, URL, and so on.This has already provided a good starting point for many websites, saving the麻烦 of manually writing and embedding structured data.

However, relying solely on the system default-generated JSON-LD may not fully meet our needs for in-depth descriptions of specific content types (such as detailed product information, recipes, events, frequently asked questions, etc.)This is when the customized features provided by Anqi CMS become particularly important.

Deep customization: using{% jsonLd %}Tag enhancement to improve search engine results display

To better control and expand the structured data of the website, Anqi CMS provides for template developers{% jsonLd %} ... {% endjsonLd %}

Utilize{% jsonLd %}The core advantage of custom tags is that we can integrate the dynamic content of the existing website seamlessly into JSON-LD by combining the powerful template tags of Anq CMS.In this way, each time the content is updated, the structured data will be updated automatically, greatly reducing the maintenance burden.

Next, let's look at several examples to see how to integrate the dynamic data of Anqi CMS into the custom JSON-LD:

1. Article page enhancement

For blog posts or news detail pages, we usually hope that search engines can display article titles, thumbnails, publication dates, authors, and even include organizational information.

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "{% tdk with name="Title" %}",
  "image": [
    "{% archiveDetail with name="Logo" %}"
  ],
  "datePublished": "{{ stampToDate(archive.CreatedTime, "2006-01-02T15:04:05Z07:00") }}",
  "dateModified": "{{ stampToDate(archive.UpdatedTime, "2006-01-02T15:04:05Z07:00") }}",
  "author": {
    "@type": "Person",
    "name": "{% archiveDetail with name="author" %}" {# 假设您在内容模型中自定义了“author”字段 #}
  },
  "publisher": {
    "@type": "Organization",
    "name": "{% system with name="SiteName" %}",
    "logo": {
      "@type": "ImageObject",
      "url": "{% system with name="SiteLogo" %}"
    }
  },
  "description": "{% tdk with name="Description" %}"
}
</script>
{% endjsonLd %}

In the above code, we used multiple template tags of AnQi CMS:

  • {% tdk with name="Title" %}: Retrieve the SEO title of the current page, as the article's headline.
  • {% archiveDetail with name="Logo" %}Get the thumbnail of the article, as the article's image.
  • {{ stampToDate(archive.CreatedTime, "2006-01-02T15:04:05Z07:00") }}Convert the article's timestamp to ISO 8601 standard and use it as datePublished.The same method is also used for dateModified.
  • {% archiveDetail with name="author" %}: If your article model defines the 'author' field, you can directly call it. Otherwise, you can replace it with other default values or system fields.
  • {% system with name="SiteName" %}and{% system with name="SiteLogo" %}: Retrieve the website's name and Logo as Organization information for the publisher.
  • {% tdk with name="Description" %}Get the SEO description of the current page, as the article's description.

2. Product (Product) detail page optimization

It is crucial for e-commerce product pages to display product prices, inventory, review ratings, and other information.

”`twig {% Ld %}