How to insert custom structured data using `Ld` tags on AnQiCMS pages to enhance search engine display effects?

Calendar 👁️ 64

When building and optimizing a website, we always hope to let the search engine deeply understand the content of our page, so that we can get a better display effect in the search results.Structured data, especially structured data presented in JSON-LD format, is an important tool to achieve this goal.AnQiCMS (AnQiCMS) is a content management system that focuses on SEO optimization and provides flexible and powerful support for inserting custom JSON-LD.

Understand the advantages of structured data and AnQi CMS

Search engines crawl web content through spiders, but text and images alone cannot fully convey the 'meaning' of the content.For example, an article about the 'AnQiCMS feature introduction' is clear to humans, but to search engines, it may just be a piece of text.If we can clearly tell the search engine that this is an article about a software product, titled 'AnQiCMS Feature Introduction', by someone, published at a certain time, with core features including content model and SEO tools ..., then the search engine can better understand and may display it in the form of 'rich media search results' (Rich Snippets), such as with star ratings, images, and publication dates, which will undoubtedly greatly increase the click-through rate of the page.

AnQi CMS provides many out-of-the-box features in SEO, such as pseudo-static, Sitemap generation, keyword library management, TDK (title, description, keywords) customization, and more.These are the basics of website SEO, and JSON-LD structured data is an advanced optimization on this basis, which can enhance the search engine's understanding of content from 'reading' to 'understanding', thereby obtaining more accurate display.

jsonLdThe core role of tags

In Anqi CMS, the system usually inserts some basic structured data in the page for the convenience of users. But if we want to finely control or supplement these data according to the needs of a specific page, we need to use the data provided by Anqi CMS.jsonLd.

jsonLdThe tag usage is very intuitive, it adopts{% jsonLd %} ... {% endjsonLd %}This structure. Its core function is to allow us to insert or modify structured data in pure JSON-LD format.What is most remarkable is that this tag is not simply replaced, but is merged with the structured data built into Anqi CMS.This means that we do not need to write the entire JSON-LD object from scratch, but only provide the fields that we want to customize or supplement.If a custom field conflicts with the system-generated field, the content we manually set will take precedence, which provides great convenience for deep customization.

How to build custom JSON-LD

The key to building custom JSON-LD lies in two points: first, being familiar with the Schema.org specifications, knowing which properties should be included for different types of content;How to obtain dynamic data from Anqi CMS template tags and fill it into JSON-LD.

The AnQi CMS template tag system is very complete, we can easily obtain various information from the page, such as:

  • Page TDK tag (tdk)Get the title, keywords, and description of the current page.
  • System settings tag (system)Get the global settings such as website name, Logo, and filing information.
  • Document details tag (archiveDetail): Get the title, content, images, publication/update time, custom fields, etc. of articles or products.
  • Category detail tag (categoryDetail): Get the name, description, images, etc. of categories.
  • Breadcrumb tags (breadcrumb)Get the page navigation path.

With these data sources, we can flexibly build JSON-LD that conforms to Schema.org standards.

For example, let's take the article detail page, assuming we want to optimize the structured data of the article:

We can place the following code snippet in the template of the article detail page (for example{模型table}/detail.html)的<head>area:

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "{% archiveDetail 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": "这里可以填写文章作者名,也可以动态获取"
  },
  "publisher": {
    "@type": "Organization",
    "name": "{% system with name='SiteName' %}",
    "logo": {
      "@type": "ImageObject",
      "url": "{% system with name='SiteLogo' %}"
    }
  },
  "description": "{% archiveDetail with name='Description' %}"
}
</script>
{% endjsonLd %}

Through the above code, we defined the article's title, main image, publication/revision time, author, publishing organization, and description. Among which{% archiveDetail %}/{% system %}as well asstampToDateFunctions directly utilize the data configured in the Anqi CMS backend, avoiding hard coding and repetitive work.

If we also want to add structured data for breadcrumb navigation on the page:

Although AnQiCMS has built-in breadcrumb tags, if you want to provide them to search engines in JSON-LD format, you can do it like this:

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {% breadcrumb crumbs %}
    {% for item in crumbs %}
    {
      "@type": "ListItem",
      "position": {{ forloop.Counter }},
      "name": "{{ item.Name }}",
      "item": "{{ item.Link }}"
    }{% if not forloop.Last %},{% endif %}
    {% endfor %}
    {% endbreadcrumb %}
  ]
}
</script>
{% endjsonLd %}

Here, we cleverly utilized{% breadcrumb crumbs %}The breadcrumb data traversed by tags, dynamically generatedBreadcrumbListStructured data of type.

The benefits of enhancing the display effect of the search engine

ByjsonLdInsert custom structured data, our website will gain many benefits:

  • Enhance rich media search results: Search engines may display more rich search results on our pages, such as article thumbnails, publication dates, product prices, star ratings, etc., which can visually attract users and increase click-through rates.
  • Enhance content understanding: Structured data clearly defines the entities and relationships of page content, helping search engines better understand the context of page content, so that when users search for related information, our pages are displayed more accurately.
  • potential ranking improvementAlthough structured data itself is not a direct ranking factor, it can improve the visibility, click-through rate, and user experience of the page, and these indirect factors are helpful for the website to perform better in search results.

In short, the Anqi CMS'sjsonLdTags provide a simple yet powerful way to control the structured data of a website.By making good use of this feature, combined with Schema.org standards, we can make the content of the website stand out in search engines and attract more target audiences.


Frequently Asked Questions (FAQ)

1. I amjsonLdWill the custom content in the tag overwrite the structured data generated by the default Anqie CMS?Yes,jsonLd

Related articles

How to correctly render Markdown content in AnQiCMS and support the display of mathematical formulas and flow charts?

In modern content management, providing rich and structured content has become the key to improving user experience and information delivery efficiency.Especially for technical blogs, product documents, or data analysis reports, the ability to visually display code, mathematical formulas, and complex flowcharts undoubtedly makes the content more attractive and readable.AnQiCMS as an efficient and customizable enterprise-level content management system fully understands this requirement and provides comprehensive Markdown support, allowing you to easily achieve these advanced content displays.

2025-11-07

How does AnQiCMS implement anti-crawling interference code through built-in features to protect the display of original content on the front end?

Today, as digital content becomes a core asset, how to effectively protect original content from malicious collection and misuse has become a common challenge for website operators and content creators.Hardly created articles, product descriptions, in a moment may appear on other websites, not only dilute the value of original content, but may also have a negative impact on the search engine rankings of websites.AnQiCMS (AnQiCMS) is fully aware of this pain point and therefore built-in anti-crawling interference code function at the initial stage of system design, aiming to build a clever and sturdy barrier for the display of original content on the front end.

2025-11-07

How to retrieve and display custom fields in the AnQiCMS template for the website message form and ensure correct submission?

In Anqi CMS, adding and managing custom fields for the website's message form can not only help us collect more specific and targeted customer information, but also significantly enhance the interactivity and data collection efficiency of the website.AnQi CMS with its flexible content model and easy extensibility makes this process very convenient.This article will guide you on how to obtain and display custom fields in the Anqi CMS template and ensure that these fields are submitted correctly.### Step 1: Define the custom message field in the Anqi CMS backend First

2025-11-07

How to display the comment list of an article in AnQiCMS template, including multi-level replies and review status indicators?

In Anqi CMS, let your article page not only be a display of content, but also an active communication platform, and the comment feature is the bridge connecting content with readers.Understanding how to flexibly display an article's comment list in a template, including multi-level replies and clear review status indicators, is crucial for building an interactive website. ### The foundation of comment functionality: Ensure backend configuration is ready Before delving into template code, we first need to confirm that the comment feature is enabled in the AnQi CMS backend.

2025-11-07

How does AnQiCMS implement different content display and adaptation for PC and mobile devices through the template directory structure?

In the era when mobile internet occupies a dominant position, ensuring that website content can be perfectly displayed on different devices is a core issue that every website operator is very concerned about.AnQiCMS provides an extremely flexible and powerful solution in this aspect, allowing us to easily provide optimized display and interaction experience for users on both PC and mobile terminals.The key to AnQiCMS achieving content adaptation for PC and mobile ends lies in its carefully designed template directory structure and flexible website mode selection.

2025-11-07

How to get and display the detailed information of the current category in AnQiCMS template, such as title, description, thumbnail, and Banner group image?

Building a website in AnQiCMS, especially when we need to present rich and accurate information on category pages, it is particularly important to deeply understand how to obtain detailed data of the current category in templates.This is not just for aesthetics, but also to provide a better user experience and search engine optimization.The AnQiCMS template system is designed to be very flexible and easy to use, it uses syntax similar to the Django template engine.

2025-11-07

How to display a multi-level nested category list in AnQiCMS, such as top-level categories and their subcategories?

When building a website, a clear and organized content structure is the foundation for improving user experience and search engine optimization.Especially for content-rich websites, how to efficiently display multi-level nested category lists, such as top-level categories and their subcategories, is a concern for many operators.AnQiCMS is a flexible enterprise-level content management system that provides intuitive and powerful template tags, allowing you to easily meet this requirement.

2025-11-07

How to retrieve and display a list of documents under a specified Tag, and support pagination?

In website content management, categorizing and displaying documents according to their tags (Tags) is an important strategy to enhance user experience and content discoverability.AnQiCMS provides a set of intuitive and powerful template tags that help us easily achieve this goal, while also supporting flexible pagination functionality, even when faced with massive amounts of content, it can maintain the page's cleanliness and loading speed.

2025-11-07