How to generate and display personalized SEO titles, keywords, and descriptions for different pages using the universal TDK tag `tdk`?

Calendar 👁️ 86

In website operation, optimizing search engines (SEO) is a key link in obtaining natural traffic.While TDK (Title, Description, Keywords) is the first impression of a page displayed in search engine results, its importance is self-evident.It not only affects the ranking of the website on the search results page, but also directly determines whether the user will click to enter your website.

AnQiCMS knows the value of TDK to SEO, and therefore provides an extremely flexible and powerful 'Universal TDK Tag'——tdkThis tag's "universal" feature lies in the fact that it is not limited to generating TDK information for the website homepage, but can also intelligently generate and display personalized SEO titles, keywords, and descriptions based on the specific content and settings of different pages on your website.

Intelligent recognition, generate personalized TDK on demand

No matter what you are editing, whether it is an article detail page, category list page, independent single page, or even a tag page,tdkTags can intelligently extract and display the most appropriate SEO information based on the specific content of the current page.The principle of its operation is to prioritize calling the SEO fields you set in the background for a specific page, if these fields are not set, it will adopt the title, summary, or default system settings of the page itself as a supplement to ensure that each page has complete TDK information.

Page Title (Title): Accurately convey the core of the page

Page's<title>Tags are the most direct signal for search engines to judge the theme of the page, and they are also the first words that users see in the search results.tdkLabels follow a smart logic when generating page titles:

  1. Priority is given to the page-specific SEO title:When you set the "SEO title" separately for articles, categories, single pages, or tags in the backend editing interface,tdkTags will prioritize these personalized titles. This allows for fine-grained title optimization for each page, making it more in line with search intent.
  2. Naturally fall back to the page title:If a page does not set a dedicated "SEO title",tdkNaturally use the title of the page itself (such as article title, category name, single page name, or tag name) to display, ensuring the integrity of the title information.
  3. Incorporate brand elements and hierarchy:
    • To incorporate brand elements in the title, you cansiteNamethe parameter totrueThus, the website name will automatically be appended to the page title after, enhancing brand recognition.
    • If the default title separator does not suit your taste,septhe parameter allows you to easily change it, for example, to an underscore_or a vertical line|.
    • especially on the category page, when you hope that the title can reflect the hierarchical relationship,showParent=trueIt can also display the title of the parent category together, enhancing the context relevance of the title.

Example:

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

Page keywords (Keywords): Guide search engines to understand the theme.

Keywords (Keywords) are important clues to tell search engines the core content of a web page.Although modern search engines have reduced the weight of Keywords, reasonable settings still help search engines better understand the theme of the page.tdkTags will be used to obtain keywords:

  1. Prioritize the specific keywords of the page:In the editing interface of documents, categories, single pages, or tags, the keywords you fill in will becometdkThe label is displayed first. This allows you to configure the most relevant keyword group for each page.
  2. Smart extraction or fallback:If the page does not set a specific keyword, the system will try to extract keywords from the page content, or fall back to the globally set default keyword (such as the home page keyword), to avoid the keyword area being empty.

Example:

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

Page Description (Description): A summary to attract users to click

Page description (Description) is the source of search engine result summaries and also an important factor in attracting users to click.A well-written description can summarize the page content and stimulate user interest.tdkThe tag also reflects its intelligence when processing the page description:

  1. Prioritize calling the page's custom introduction: tdkThe tag will first capture the 'Document Introduction', 'Category Introduction', 'Single Page Introduction', or 'Tag Introduction' set in the page background.These custom introductions are the marketing copy tailored for this page.
  2. Intelligent content extraction summary:If these custom descriptions are not filled in, the system will intelligently extract a paragraph of text from the page content as a description, typically the first 150 words or so, to ensure that there is always a description displayed on the page, even if you forget to fill it in manually, the page will not appear empty in the search results.

Example:

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

Standard Link (CanonicalUrl): A Tool to Avoid Duplicate Content

In SEO practice, the canonical URL is an important tool to solve the problem of content duplication.When your website has multiple URLs pointing to the same content (such as URLs with parameters, different versions of URLs), setting a canonical link can tell search engines which is the 'original' version of the content, thereby concentrating ranking weight and avoiding punishment.

tdkTags can also access this field. To avoid invalid content on the page.canonicalLabel, we usually check if the standard link exists before outputting:

Example:

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

This, if the background sets a specification link for the current page, it will be correctly added to the page header; otherwise, the tag will not be displayed.

Apply comprehensively: integrate TDK tags into the page header

Usually, we will place all TDK tags in the HTML page<head>area as shown below:

``twig <!DOCTYPE html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# 页面标题,附加网站名称,使用下划线分隔,并显示父级分类标题 #}
<title>{% tdk with name="Title" siteName=true sep="_" showParent=true %}</title>
{# 页面关键词 #}
<meta name="keywords" content="{% tdk with name="Keywords" %}">
{# 页面描述 #}
<meta name="description" content="{% tdk with name="Description" %}">
{# 规范链接,如果存在则显示 #}
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}

Related articles

How to dynamically display the `contact` label of the company contact information?

In website operation, clear, accurate and easy-to-update business contact information is a crucial link.Imagine if you need to update your contact phone number or email, do you need to manually modify every web page that contains this information?This is not only time-consuming and labor-intensive, but may also lead to inconsistent information due to omissions, affecting user experience and brand image. AnQiCMS (AnQiCMS) is well-versed in this, and to address this pain point, it has specially provided the **contact label `contact`**.

2025-11-07

How to get and display the website global information using the AnQiCMS system settings label `system`?

In website construction and daily operation, we often encounter situations where we need to display some global information, such as the name of the website, Logo, filing number, contact information, etc.This information runs through the entire website and needs to be consistent across multiple pages.AnQiCMS provides an extremely convenient way to handle this type of global information, which is through its built-in `system` template tag.

2025-11-07

What is the impact of folder organization mode and flat file organization mode on template production and content display?

When building website templates in AnQi CMS, the organization of template files is one of the core issues you need to pay attention to.AnQi CMS provides two main template organization modes: **Folder Organization Mode** and **Flattened File Organization Mode**.These two modes have their own characteristics, and their choice will directly affect the efficiency of your template creation and the final presentation of the content.Understand their differences and impacts, which can help you make more informed decisions based on project needs.### Folder Organization Mode

2025-11-07

How to configure specific template files for the homepage, detail page, list page, etc. of AnQiCMS to control the display?

AnQiCMS, with its high efficiency and flexible customization features developed in the Go language, provides strong control over the display of website content.Whether you are operating a small and medium-sized enterprise website, a personal blog, or need to manage multiple sites, understanding how to configure exclusive templates for different pages is the key to improving website personalization and user experience.In AnQiCMS, the core of content display lies in the template files.These files determine the visual layout, content formatting, and interactive elements of the website.AnQiCMS uses a syntax similar to Django template engine

2025-11-07

How to build and display the hierarchical navigation menu of the website's navigation list label `navList`?

In website operation, a clear and convenient navigation menu is the key to user experience, as well as an important basis for search engines to understand the website structure.AnQiCMS provides powerful navigation management features, and its template tag `navList` is the core tool for building these hierarchical navigation menus on the front end.

2025-11-07

How to dynamically generate and display the current page's breadcrumb navigation path? breadcrumb

In website operation, a clear navigation path is crucial for user experience and search engine optimization.Imagine, when users browse your website, it's like exploring a strange city. If they can always see where they are and how they got there, it will greatly enhance their confidence and browsing efficiency.This is the value of breadcrumb navigation (Breadcrumb Navigation).It is like a trail of breadcrumbs in your hand, providing a clear path for users from the homepage to the current page.

2025-11-07

Label for category list `categoryList` how to get and display article, product category information?

Manage and display website content in AnQiCMS, the classification information plays a vital role.Whether it is to organize product catalogs or organize article topics, a clear classification structure can greatly enhance user experience and the navigation efficiency of the website.And the `categoryList` tag is a powerful tool provided by AnQiCMS, helping us to flexibly obtain and display these category information.The `categoryList` tag is mainly used to retrieve and loop through the category data on your website.

2025-11-07

Category detail label `categoryDetail` how to get and display detailed information of a specific category?

In Anqi CMS website content operation, we often need to accurately obtain and display detailed information of specific categories.Whether it is displaying the name, description, or associated images and content of a category, the `categoryDetail` tag can provide flexible and powerful support to help us build dynamic and rich category pages. ### `categoryDetail` tag's core features and basic usage The `categoryDetail` tag is used to obtain detailed data for a single category.

2025-11-07