In website operation, the dynamic display of the SEO title (Title), keywords (Keywords), and description (Description) at the page header, abbreviated as TDK, is a core element of search engine optimization (SEO).They can not only help search engines understand the page content, but are also the key to attracting users to click.For users of AnQiCMS, the system provides a powerful and flexible mechanism to implement TDK dynamic management, ensuring that each page can achieve excellent SEO performance.
The importance of TDK and the intelligent support of AnQiCMS
Search engines use TDK as the primary signal to identify the theme of your page when crawling and indexing your website.A well-optimized title can directly affect the click-through rate of users in search results; appropriate keywords can enable your content to be precisely discovered by potential users; and an attractive description can further encourage users to visit.
AnQiCMS knows the value of TDK for SEO, therefore it designed a highly intelligent 'Universal TDK Tag'.This tag does not require you to manually judge the type of the current page (whether it is the homepage, article detail page, category page, or single page), it can automatically identify and extract TDK information from the corresponding backend settings, greatly simplifying the development and maintenance work at the template level.
How to set TDK in the AnQiCMS background?
AnQiCMS provides a refined TDK setting entry for different types of pages, ensuring that you can optimize accurately according to the characteristics of the content.
Homepage TDK settings:The TDK on the homepage usually represents the core theme and brand positioning of the entire website.In AnQiCMS background, you can uniformly configure the title, keywords, and description of the website homepage in "Background Settings" -> "Homepage TDK Settings".This information will serve as the "front page" of your website, affecting the overall SEO weight.
Article, Product Detail Page TDK:Each independent content (such as an article or product) should have a unique TDK.When editing articles or products, you can usually find fields such as 'SEO Title', 'Keywords', and 'Document Summary' in the 'Other Parameters' section of the editing interface.Suggest that you fill out this information for each content.If you do not fill in the 'SEO title' or 'document summary', the system will intelligently use the 'document title' and automatically extracted 'document summary' as the default value.
Category Page TDK:The category page of the website also carries important SEO value.In the "Content Management" -> "Document Category" editor, in the "Other Parameters" section, you can set the "SEO Title", "Keywords", and "Category Description" for the category.These settings will be applied to all list pages that belong to this category.
Single Page TDK:like "About UsIn the 'Page Resources' -> 'Page Management', when editing a single page, you can find fields such as 'SEO Title', 'Keywords', and 'Single Page Description' to configure.
Tag Page TDK:AnQiCMS also supports setting independent TDK for content tags.When editing a tag in "Content Management" -> "Document Tags", you can also configure the "SEO Title", "Tag Keywords", and "Tag Description" in its settings.
Dynamic Display of TDK in Template:
AnQiCMS universal TDK tag (tdk) Is the core for dynamic display. It intelligently selects the most appropriate TDK content based on the context of the current page. Usually, you only need to place it in the website template's<head>Place the following code snippet in the area to enable dynamic management of the entire site TDK:
<!DOCTYPE html>
<html lang="{% system with name='Language' %}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# 动态显示页面标题 #}
<title>{% tdk with name="Title" siteName=true %}</title>
{# 动态显示页面关键词 #}
<meta name="keywords" content="{% tdk with name="Keywords" %}">
{# 动态显示页面描述 #}
<meta name="description" content="{% tdk with name="Description" %}">
{# 可选:显示规范链接,有利于SEO #}
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
{# 可选:多语言网站的hreflang标签,帮助搜索引擎理解多语言版本 #}
{%- languages websites %}
{%- for item in websites %}
<link rel="alternate" href="{{item.Link}}" hreflang="{{item.Language}}">
{%- endfor %}
{%- endlanguages %}
{# 其他页面头部内容,如CSS链接、Favicon等 #}
<link href="{% system with name="TemplateUrl" %}/css/style.css" rel="stylesheet">
</head>
<body>
<!-- 页面主体内容 -->
</body>
</html>
This code is usually placed in your template's public file, for example:bash.htmlorheader.htmlThis ensures that all pages inherit and display the TDK information correctly.
Code analysis:
<title>{% tdk with name="Title" siteName=true %}</title>:tdkThe tag automatically retrieves the SEO title of the current page.siteName=trueThe parameter indicates that the website name is appended to the title, for example, "Article Title - Your Website Name", which helps to enhance brand exposure.<meta name="keywords" content="{% tdk with name="Keywords" %}">Get the SEO keywords of the current page.<meta name="description" content="{% tdk with name="Description" %}">Get the SEO description of the current page.{% tdk with name="CanonicalUrl" %}If the page has set a specification link, this tag will be output. The specification link is crucial for avoiding duplicate content and integrating page authority.{% system with name='Language' %}: Obtain the current site's language code from the system settings, used for HTML'slangattribute to enhance the page's accessibility and international SEO.{% languages websites %}This tag is used for multilingual sites, it lists all language versions of the website links, and generateshreflangtag indicating that the search engine has other language or regional versions of this page.
Some considerations in practice
- Priority of TDK:AnQiCMS's TDK tags follow the priority principle: The SEO settings of specific pages (such as the custom SEO title of article detail pages) take precedence over the settings of their respective categories, and the category settings take precedence over the global homepage TDK settings.This hierarchical relationship allows you to perform fine-grained SEO control.
- Title separator:
tdkThe tag also supports passing throughsepSeparator for custom parameter title, for example{% tdk with name="Title" siteName=true sep=" | " %}. - Go language time format:In the template, all operations involving time formatting, such as
{{stampToDate(item.CreatedTime, "2006-01-02")}}, must follow the specific date format of the Go language, namely using2006年01月02日15时04分05秒as the reference template.
AnQiCMS through its intelligent TDK tags and flexible backend configuration greatly simplifies the SEO optimization work of the website.By the above introduction, you can easily implement the dynamic display of TDK, in order to win better visibility for your website in search engines.
Frequently Asked Questions (FAQ)
How will AnQiCMS handle it if the SEO title, keywords, and description of a page are not filled in?If the SEO title, keywords, or description of a specific page is not manually filled in, AnQiCMS will try to obtain it according to certain fallback logic.For example, the article detail page will try to use the title of the article itself and the automatically generated summary; the category page may use the category name and category introduction.For the homepage, if not set, it may display default information such as the website name.Although the system has a default processing mechanism, we strongly recommend that you manually fill in the TDK for each important page for **SEO effects.
tdkin the labelsiteName=trueWhat is its function? Will it affect the SEO title I fill in manually?siteName=trueThe parameter is used to automatically append the website name (from the "Global Settings") to the TDK title on the current page.For example, if the SEO title of your article is "AnQiCMS Quick Start", and the website name is "AnQiCMS Official Website", the final displayed title may be "AnQiCMS Quick Start - AnQiCMS Official Website".This parameter will not affect the SEO title content you manually fill in, it is just appended at the end, which helps to enhance brand visibility and recognition.**except
tdkUniversal tag, I