How to dynamically generate the page's Title, Keywords, and Description (TDK) to optimize SEO display?

Calendar 81

In website operation, Title (title), Keywords (keywords), and Description (description) - abbreviated as TDK, are core elements of Search Engine Optimization (SEO).They directly affect the display of the website on the search engine results page (SERP), thereby determining the click-through rate and traffic of the website.It is neither realistic nor efficient to manually set TDK for each page of a content-rich website.AnQiCMS as a powerful content management system provides flexible mechanisms to help users dynamically generate and manage these key SEO elements, thus achieving more refined optimization.

The importance of TDK in SEO

Before delving into how AnQiCMS dynamically generates TDK, it is necessary to briefly review the SEO value of TDK.

  • Title (Title)This is the information that users see first in search engines, and it is one of the most important bases for search engines to judge the theme of the page.A well-written title can accurately convey the content of the page, attract user clicks, and include core keywords to help improve relevance ranking.
  • Keywords (Keywords): Although modern search engines have reduced the weight of the Keywords meta tag, it can still be used as auxiliary information to help search engines understand the focus of the page content.What is more important, in AnQiCMS, the "document keywords" field during content management can provide richer SEO information for content models (such as articles, products) and be effectively utilized.
  • Description (Description): The page description meta tag is usually displayed as a snippet in the search engine results page.An attractive description containing keywords that can stimulate user interest and improve click-through rate.

The core value of dynamically generating TDK lies in the fact that it allows each page of the website to have a unique and highly relevant TDK, avoiding duplicate content issues and greatly enhancing the overall SEO performance of the website.

Basic TDK configuration in AnQiCMS

AnQiCMS divides TDK configuration into global settings and fine-grained management at the content level, ensuring comprehensive coverage from macro to micro.

Firstly, for the website'shome page TDKYou can uniformly configure it under 'Home TDK Settings' in the 'Background Settings' on the backend.Here you can set the title, keywords, and description of the homepage, laying the SEO foundation for the entry page of the website.These settings are usually fixed and unchanged, representing the core theme and brand information of the website.

While the dynamic TDK generation of website content mainly depends on AnQiCMSContent modelThe powerful function. Whether it is an article detail page, product detail page, category list page, or tag page and single page, AnQiCMS provides the corresponding fields to allow users to customize the TDK information for each content item.

  • Articles and productsIn the process of adding or editing a document, you will find fields such as 'SEO Title', 'Document Keywords', and 'Document Summary'.Amongst, the "SEO title" allows you to set a special title for this article/product that is used for search engines, distinguishing it from the H1 title displayed on the page.“Document keywords” are used to input keywords highly relevant to the content, while “Document summary” provides the content source for the page Description.If the 'Document Summary' is left blank, the system will usually automatically extract the first 150 characters of the article body as a description.
  • Category PageIn the add or edit interface of the document category, you can also find the fields of 'SEO title', 'keywords', and 'category introduction'.These will be used for the category list page's TDK. When the 'category introduction' is not filled in, the system will use the category name as part of the Title and try to extract the Description from other metadata.
  • Tab page: Similar to the category page, in the addition or editing of 'Document Tags', 'SEO Title', 'Tag Keywords', and 'Tag Description' can help you define TDK for a specific tag page.
  • single page: For independent pages such as "About Us", "Contact Information", and others, you can also independently set "SEO Title", "Keywords", and "Single Page Description" in "Page Management" to ensure that each single page has its own unique TDK.

This hierarchical management method allows website administrators to flexibly set TDK according to the importance and characteristics of the content, thereby maximizing SEO benefits.

Dynamically call TDK in the template:{% tdk %}The art of tags

One of the core charms of AnQiCMS lies in its concise and efficient template tag system. To achieve the dynamic generation and display of TDK,{% tdk %}The tag is your helpful assistant. This versatile TDK tag can intelligently read the corresponding TDK data based on the type of the current page (home page, article page, category page, etc.) and output it.

Generally, you would place these tags in a template file (such asbase.html, which is the common header template of the website) of<head>Within the area.

1. Dynamically generate page title (Title)

Page's<title>Tags are the most important part of SEO. Use{% tdk with name="Title" %}Can get the most appropriate title for the current page. AnQiCMS provides additional parameters to make the title generation more intelligent and flexible:

  • Default call:{% tdk with name="Title" %}This will intelligently retrieve the title of the current page. For example, on an article detail page, it will display the 'SEO title' (if set) or the article title;On the category page, it displays the category name; on the homepage, it displays the title configured in the homepage TDK.
  • Add website name suffix:siteName=trueYou usually want to include the brand name of the website in the title.{% tdk with name="Title" siteName=true %}It will automatically append the website name configured in the "Global Settings" to the page title.
  • Custom delimiter:sep=" - "You can go throughsepThe separator between the page title and the website name can be customized, the default is a hyphen. For example,{% tdk with name="Title" siteName=true sep=" | " %}The separator will be " | ".
  • Display parent category title:showParent=trueIn some category list pages or detail pages, you may want the title to include the name of its parent category to provide more complete hierarchical information.{% tdk with name="Title" showParent=true %}This can meet this need.

A typical Title tag application is as follows:

<title>{% tdk with name="Title" siteName=true sep=" - " %}</title>

This line of code will intelligently output titles such as 'Article Title - Website Name', 'Category Name - Website Name', and so on.

2. Dynamically generate page keywords (Keywords)

Keyword meta tags may not have the weight they used to, but they still provide contextual information.

<meta name="keywords" content="{% tdk with name="Keywords" %}">

This tag dynamically retrieves the "document keywords", "tag keywords", or "category keywords" configured on the current page.If the page does not set a specific keyword, it may be left blank or try to extract it from the content.Suggest filling in the keywords manually in the corresponding content editing interface in the background, and use English commas,Separate it to ensure its accuracy.

3. Dynamically generate page description (Description)

The page description meta tag is the key information to attract users to click, it should be concise and summarize the content of the page.

<meta name="description" content="{% tdk with name="Description" %}">

{% tdk with name="Description" %}Extracts the document summary, category summary, or single-page summary set in the corresponding content items (articles, products, categories, tags, single pages) in the background. If these fields are empty, AnQiCMS will intelligently extract a paragraph of text from the main content of the page as a description, but it is recommended to write manually for SEO purposes

Related articles

How to conveniently display the company's contact phone number and address with the `contact` tag?

In website operation, clearly and conveniently displaying the company's contact information is a key link to enhance user trust and promote business communication.Whether it is to seek cooperation, provide customer support, or simply to let visitors understand the location of the company, contact information plays a vital role.AnQiCMS fully understands this and provides us with an extremely convenient way to manage and display this information through its powerful template tag system.

2025-11-08

How to dynamically display the website filing number and copyright information through the `system` tag in the footer?

When operating a website, the filing number and copyright information are an indispensable part of the website. They are not only the symbol of the legitimate operation of the website but also reflect the respect for original content.For AnQiCMS users, managing this information and displaying it dynamically through the footer is a convenient and efficient operation.AnQiCMS provides an intuitive backend setting and flexible template tags, allowing you to easily meet this requirement, saving the trouble of manually modifying the code on each page.

2025-11-08

How to use the `system` tag to display the website name and logo on the page?

## Easily Solved: How to Gracefully Display Your Website Name and Logo on AnQiCMS Page It is crucial to display brand identity when operating a website.The website name and logo are not only the key elements for visitors to identify your brand, but also the foundation for enhancing the professionalism and trust of the website.AnQiCMS provides a直观而强大的template tag system that allows you to easily call and display these core information on any page of the website.Among them, the `system` tag is specifically designed to obtain this type of global site configuration. Next

2025-11-08

How to implement the reuse of the common part of AnQiCMS templates (such as headers and footers)?

In AnQiCMS, efficient website content management is inseparable from a flexible and easy-to-maintain template system.You may encounter such a need when creating a template: headers, footers, navigation bars, and other common elements need to appear on every page of the website.If repeating the same code on each page is not only time-consuming and labor-intensive, but also modifying it in the future will cause a domino effect.Luckyly, AnQiCMS leverages the powerful functions of the Django template engine to provide an elegant solution, allowing these common parts to be easily reused.### Core Foundation

2025-11-08

How to use the `navList` tag to build a website navigation menu with secondary dropdown?

Build a clear and easy-to-use website navigation menu is an important link to improve user experience and website professionalism.In AnQi CMS, we can take advantage of the powerful `navList` tag to easily implement a navigation menu with secondary dropdown support, making the website content well-structured and convenient for visitors to browse.Next, we will explore how to use the `navList` tag, from backend configuration to frontend template rendering, step by step to create a complete second-level dropdown navigation.

2025-11-08

How to automatically generate breadcrumb navigation using the `breadcrumb` tag and customize the display text on the homepage?

The user experience of a website largely depends on the convenience and clarity of navigation.When the visitor delves into the website content, a friendly 'Breadcrumb Navigation' can clearly indicate the current position and provide a quick path to return to the upper page.AnQiCMS is well-versed in this, providing a powerful and easy-to-use `breadcrumb` tag that allows website administrators to automatically generate paths without complex coding, and even to flexibly customize the display text on the homepage.

2025-11-08

How to use the `categoryList` tag to display the list of articles/products categories on the homepage or sidebar?

When building and optimizing a website, a clear navigation structure is crucial for user experience and search engine optimization.AnQiCMS (AnQiCMS) provides us with powerful template tags, among which the `categoryList` tag is a core tool used to flexibly display article or product category lists on the homepage or sidebar of the website.With it, we can easily organize the content of the website neatly, allowing visitors to find the information they are interested in at a glance.Why is the category list so important? Imagine when visitors come to a rich content website

2025-11-08

How to retrieve and display the name, description, and thumbnail of a specific category?

In website operations, clearly and effectively displaying classification information is crucial for user experience and search engine optimization.A specific category name can help users quickly understand the content theme, a concise description can provide more background information, and a direct thumbnail can attract users to click.AnQiCMS (AnQiCMS) provides a powerful and flexible template tag feature, allowing you to easily obtain and present these key classification information, whether it is to build a navigation menu, design a category list page, or optimize search engine results.###

2025-11-08