How to dynamically generate and display SEO titles, keywords, and descriptions for `tdk` tags on different pages?

Calendar 👁️ 77

In website operation, the title (Title), keywords (Keywords), and description (Description), abbreviated as TDK, are indispensable core elements of search engine optimization (SEO).They not only directly affect the display of the website on the search engine results page (SERP), but also determine whether users click to enter your website.AnQiCMS deeply understands the importance of TDK and provides a powerful and flexible mechanism to help us dynamically generate and display TDK tags on different pages, thereby effectively improving the SEO performance of the website.

The universal core of TDK in AnQiCMStdkTag

AnQiCMS has provided us with a namedtdkThe universal template tag, it is the core of handling the TDK of the website page.No matter which page of the website you are on - homepage, article detail page, category list page, or even a custom single page - this tag can intelligently retrieve and output the most relevant TDK information for the current page.Its design purpose is to simplify TDK management, allowing website content to automatically present the most matching SEO elements according to the specific context of the page.

Dynamic generation and display: TDK strategies for different pages

The TDK generation logic of AnQiCMS is hierarchical and has an intelligent 'safety net' mechanism.It usually prioritizes reading the most specific TDK settings on the current page;If the current page is not set, it will trace back to its category or model it belongs to, until it reads the default settings of the entire site, ensuring that every page has appropriate TDK information.

1. Website home page TDK configuration

For the "front door" of the website - the homepage, we need to plan the TDK globally. In the AnQiCMS backend, we can“Backend Settings”->“Home TDK Settings”To configure the title, keywords, and description of the home page uniformly.

In the template file, we can call this information like this:

<title>{% tdk with name="Title" siteName=true %}</title>
<meta name="keywords" content="{% tdk with name="Keywords" %}">
<meta name="description" content="{% tdk with name="Description" %}">

BysiteName=trueParameters, we can conveniently append the website name at the end of the title, enhancing brand recognition.

2. TDK for content detail pages such as articles and products

When the user browses a specific article or product page, the TDK should accurately reflect the characteristics of the content. AnQiCMS allows us to“Content Management”->“Publish Document”(or Product)At the time, set 'SEO title', 'document keywords', and 'document description' (usually used as a description) separately for each piece of content.

If these fields are filled in, they will be displayed as the priority TDK for the current page.If not filled in, the system will intelligently extract information from the article title, content keywords, and article summary as a substitute.

In the template of the detail page, you can use the sametdkTag to dynamically display:

<title>{% tdk with name="Title" siteName=true sep="_" %}</title>
<meta name="keywords" content="{% tdk with name="Keywords" %}">
<meta name="description" content="{% tdk with name="Description" %}">

here,sep="_"The parameter defines the separator between the website name and the page title in the title, allowing us to adjust the display effect to our liking.

3. Category and Tag List Page TDK

The category list page and tag list page carry a collection of content sets with specific themes, and their TDK should highlight the thematic nature. In“Content Management”->“Document Classification”or“Document Tags”In it, we can set 'SEO Title', 'Keywords', and 'Category Description' or 'Tag Description' for each category or tag.

Similarly, these settings will take precedence over the TDK display of the global or upper-level page. We still use it in the list page template of categories or tags.tdkCall the tag

<title>{% tdk with name="Title" siteName=true showParent=true %}</title>
<meta name="keywords" content="{% tdk with name="Keywords" %}">
<meta name="description" content="{% tdk with name="Description" %}">

It is worth mentioning that on the category page,showParent=trueParameters can include the name of the parent category in the title, for example, “Electronics - Mobile Category - Some Brand Mobile”, which is very useful for websites with a deep hierarchy structure, as it helps search engines better understand the context of the page.

4. Custom Single Page TDK

For custom single pages such as "About Us", "Contact Us", in"Page Resources" -> "Page Management"In the same way, you can set independent 'SEO title', 'keywords', and 'single page introduction'.

The calling method should be consistent with the above page, ensuring that each custom single page has accurate TDK information.

Management of standard links (Canonical URL)

In addition to TDK, the canonical URL is also an important part of SEO. It is used to inform search engines of the preferred version of a page, avoiding duplicate content issues. AnQiCMS also goes throughtdkThe tag provides a call to the specification link:

{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}

Here we useifthe statement to judgeCanonicalUrlIf it exists, output it<link rel="canonical">Tag, it is a good practice to avoid outputting empty tags.

Summary

BytdkThis flexible universal tag greatly simplifies the management and display of website TDK.It provides multi-level TDK setting options, from global to page, to intelligent default values, ensuring that every corner of the website has a good SEO foundation.At the same time, the refined title control parameters and support for standard links further enhance the visibility and authority of the website in search engines.Make full use of these features, your website will be able to go further on the road of content marketing and brand promotion.


Frequently Asked Questions (FAQ)

  1. If I don't set TDK for a page in the background, how will AnQiCMS handle it?AnQiCMS has an intelligent "bottom-line" mechanism.If a specific TDK field (such as SEO title) on a page is not filled in, the system will try to extract information from the main content of the page as a substitute (for example, using the article title as the title, and the article summary as the description).If the page content itself lacks this information, the system will further trace up, trying to use the TDK settings of the category or model page, and ultimately if all levels do not have it, it will use the global TDK configured in the "home page TDK settings" as the default value.This ensures that each of your pages does not lack TDK information.

  2. Can I hard-code TDK information directly in the template? What are the risks?In theory, you can directly write in the template file<title>...</title>or<meta name="keywords" ...>Tags and hardcoded content are not recommended, especially for dynamically generated pages.Hardcoding will cause all pages to display the same TDK, which is not conducive to SEO and may be considered duplicate content by search engines, thus reducing the weight of the website.AnQiCMS oftdkThe tag is intended to dynamically generate based on page content, which is the practice that conforms to SEO**. Only on a few static pages, and when the content really does not need any dynamic changes, might consider hardcoding, but this is usually achieved through 'single page management' on the backend, rather than directly modifying the template file.

  3. tdklabel'sshowParent=trueWhen is the parameter most useful? showParent=trueThe parameter is very useful when dealing with websites with clear hierarchy structures (such as e-commerce website product categories, large portal article channels)It can combine the title of the current page with the title of the parent category to form a more descriptive complete title.For example, on an electronic product website, 'Mobile Accessories' is a subcategory under the 'Mobile' category. Then, if the title of the 'Mobile Accessories' page is setshowParent=trueThis may be displayed as

Related articles

What global website information and contact details can the `system` tag and `contact` tag retrieve and display?

In the daily operation of AnQiCMS, the global information and contact information of the website are highly concerned by users and frequently change.How to efficiently and uniformly manage and display this information is an important standard for measuring the flexibility of a content management system.AnQiCMS provides an extremely convenient solution for calling website content and contact information through its unique template tag system, especially the core tags `system` and `contact`.

2025-11-08

How is the `bannerList` tag used to fetch and display the carousel of the website homepage or a specific group?

When building modern websites, the banner carousel is a commonly used element to enhance visual appeal and convey important information.They are usually located in prominent positions on websites, such as the top of the homepage, to display the latest activities, featured products, or important announcements.In AnQiCMS (AnQiCMS), managing and displaying these carousel images becomes very convenient, mainly due to its powerful template tag system, especially the `bannerList` tag.`bannerList`

2025-11-08

How to build a clear breadcrumb navigation through `breadcrumb` tags to enhance users' sense of positioning on the website?

In website operation, how to keep visitors from getting lost in the vast content while browsing, and maintain a clear sense of orientation, is a crucial issue.Imagine if a user delves into a page on a website and is unclear about where they came from or their level, they are likely to feel confused and even choose to leave.At this time, a well-designed and functional breadcrumb navigation can play a key role, it is like a 'road sign' in the digital world, providing users with a clear return path.AnQiCMS (AnQiCMS) is deeply skilled in content management and user experience

2025-11-08

How to implement the `navList` tag for flexible display of top, bottom, or sidebar navigation menus on a website?

The website navigation is a guide for users to explore the website content and is also an important clue for search engines to understand the website structure.A well-designed, flexible navigation system that can greatly enhance user experience and website SEO performance.In AnQiCMS, the `navList` tag is just such a core tool that gives us great freedom, allowing us to easily build and manage navigation menus at various positions such as the top, bottom, and sidebars of the website.

2025-11-08

How to use the `archiveParams` tag to retrieve and display the content of the custom parameter fields of the document?

In daily website operations, we often encounter the need that standardized content fields can no longer meet the diversified display of information.For example, a product detail page may need to display unique attributes such as "model", "material", "warranty period", etc., while a regular article may need additional notes such as "source of the article", "estimated reading time", etc.

2025-11-08

How to customize the display template for articles, products, and single pages in AnQiCMS?

In AnQiCMS, customizing the display templates for articles, products, and single pages is a very flexible and powerful feature that allows you to create exclusive display styles for different types of content according to the unique needs of your website.By carefully designed templates, not only can the user experience be improved, but also the focus of the content can be better highlighted, achieving the unity of brand style.AnQiCMS uses a template engine syntax similar to Django, which means if you are familiar with this concise and intuitive syntax, you can quickly get started.

2025-11-08

How to display custom fields defined in the AnQiCMS content model on the front end?

AnQiCMS's flexible content model is one of its core advantages, allowing us to define unique fields for different types of content according to actual business needs, thereby freeing ourselves from the limitations of traditional CMS fixed content structure.When we create these custom fields, the next critical step is to display them elegantly on the website frontend.This article will introduce you in detail how to define custom fields in the AnQiCMS backend, as well as how to flexibly call and display this information in the frontend template, making your website content more personalized and practical.### One

2025-11-08

How does AnQiCMS implement the switch of multilingual content and correct display?

In order to meet the content operation needs of globalization, it is a key step to enable your website to support multi-language content switching and correct display, expanding the market and enhancing user experience.AnQiCMS (AnQiCMS) is a feature-rich content management system that provides an intuitive and powerful multilingual solution, helping you easily meet this challenge.Next, we will discuss in detail how to achieve this goal in AnQiCMS.

2025-11-08