How to set the page title, keywords, description, and attach the website name using the `tdk` tag in AnQiCMS?
As an experienced CMS website operation personnel, I am well aware of the core position of content in website construction and SEO optimization.TDK (Title, Description, Keywords) tags are an important basis for search engines to understand page content and determine relevance, as well as the information users see first on the search results page.Efficiently setting and optimizing TDK is crucial for attracting target users and improving website ranking.Our Anqi CMS provides flexible and powerful TDK management functions, allowing us to finely control the metadata of each page.
Overview of TDK settings in AnQi CMS
In Anqi CMS, the TDK settings follow the principle of hierarchical management, with both global website homepage TDK configurations and refined settings for specific content pages, ensuring that we can flexibly adjust according to different content types and optimization objectives.
Website home page TDK configurationThe home page TDK usually represents the core business and brand positioning of the entire website.On the Anqi CMS backend management interface, we can navigate through the menu to enter the 'Backend Settings' under 'Homepage TDK Settings' to configure the title, keywords, and description of the website homepage.
- Home titleThis is the main title displayed on the website homepage in the browser tab and search results. The writing should include the brand name and core business keywords, striving to accurately summarize the theme of the website.
- Home page keywordsAlthough the weight of keywords has decreased in modern SEO, they can still be set in AnQi CMS.Suggest filling in core keywords highly relevant to the overall content of the website, separated by English commas.
- Home page descriptionThis is the summary information displayed on the website homepage in search results. It should attract users to click and accurately convey the value of the website, including key information and call-to-action language.
Content-level TDK managementIn addition to the home page, AnQi CMS also allows us to set independent TDKs for various content types on the website, including documents (articles, products, etc.), category pages, single pages, and tag pages.This provides great convenience for us to carry out detailed page-level SEO optimization.
- Document TDKIn addition to adding or editing documents such as articles or product detail pages, we can find fields such as 'SEO Title', 'Document Keywords', and 'Document Introduction' in the editing interface.
- SEO titleCover the default document title, usually for optimization purposes, and include core keywords.
- Document keywordEnter keywords closely related to the document content, separated by English commas.
- Document Introduction: The system will automatically extract the first 150 words of the document content as the default introduction, but we can also manually write a more attractive and keyword-rich description.
- Category TDKFor the classification page of articles or products, in the "Document Classification" management interface, each category can be set to "SEO Title", "Keywords", and "Category Description".These settings will apply to all document list pages under this category.
- Single Page TDK:For independent single pages such as "About Us" and "Contact Us", we can set "SEO Title", "Keywords", and "Single Page Description" for them in "Page Management".
- Tag TDKThe AnQi CMS tag feature is powerful, each tag page can also be independently set to 'SEO title', 'tag keywords', and 'tag description', which helps optimize long-tail keywords.
These content-level TDK settings have a higher priority than the global settings on the homepage, ensuring that the metadata of each specific page accurately reflects its content, thereby achieving better search performance.
UtilizetdkTags are implemented in the template to achieve flexible TDK calls
In the AnQi CMS template system,tdkThe tag is the core tool for realizing the dynamic call of TDK. It can intelligently obtain and output the corresponding TDK information according to the type of the current page (home page, document page, category page, etc.), and supports customized requirements such as additional website names.
Page title (<title>Settings and website name attachmentThe page title is the most important element in TDK, directly affecting click-through rate and ranking. UsetdkThe basic syntax for calling the page title tag is{% tdk with name="Title" %}.
To implement the title appended with the website name,tdkTags providedsiteNameattribute. When we want to automatically add the website name after the page title, justsiteNameis set totrue:
<title>{% tdk with name="Title" siteName=true %}</title>
HeresiteName=trueIntelligently retrieve the website name from the system settings and append it to the title of the current page. In addition, we can alsosepThe attribute customizes the separator between the title and the website name, the default is a hyphen-:
{# 使用下划线作为分隔符 #}
<title>{% tdk with name="Title" siteName=true sep="_" %}</title>
For category or document detail pages, we may also need to reflect the parent structure in the title, at this timeshowParentThe attribute comes into play:
{# 显示父级分类标题 #}
<title>{% tdk with name="Title" siteName=true showParent=true %}</title>
Page keywords (<meta name="keywords">) configurationThe keyword of the page passes throughmetaTag presentation, although its direct impact on SEO is no longer as great as before, it is still a way to convey the theme of the page to search engines. In AnQi CMS, we can call the keywords of the page in the following way:
<meta name="keywords" content="{% tdk with name="Keywords" %}">
tdkThe tag will automatically obtain the keywords set on the current page (whether it is the homepage, document page, category page, or tag page).
Page description (<meta name="description">Optimization)The page description is a summary in the search results, and its writing quality directly affects the user's willingness to click. ThroughtdkThe way tags call the page description is similar to keywords:
<meta name="description" content="{% tdk with name="Description" %}">
The system will prioritize obtaining the description configured on the current page, if not set, it will be filled according to the default rules (such as document introduction).
Use of standardized links (<link rel="canonical">)A standard link is an important SEO element used to solve content duplication issues, specifying the "preferred" URL that search engines should index.In AnQi CMS, documents and single pages can be set with standard links.We can call it like this in the template:
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
Here we first assign the value of the specification link tocanonicalthe variable, then check if the variable exists. If it exists, it will be output.<link rel="canonical">the tag, which is a safe practice.
Comprehensive example: Build a complete page header TDK
Integrate the above TDK tags into the website template<head>An area that can constitute a perfect page header TDK structure. Usually, this code is placed in the template file.bash.html(Common header file) or the specific page template.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# 页面标题,附加网站名称,并显示父级分类标题 #}
<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" %}">
{# 规范链接 #}
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
{# 其他SEO元数据或CSS/JS链接 #}
<link rel="stylesheet" href="{% system with name="TemplateUrl" %}/css/main.css">
{# ... #}
</head>
<body>
{# 页面内容 #}
</body>
</html>
By such configuration, Anqi CMS can dynamically generate metadata suitable for the current page type based on the TDK information configured in the background, greatly enhancing the flexibility and efficiency of SEO.
The importance of TDK optimization in website operation
The optimization of TDK tags is not just about filling in a few keywords, it is a continuous and strategic task.A well-optimized page title and description can effectively attract users to click on the search results page, thereby increasing the website's traffic.An accurate keyword layout helps search engines better understand the page theme, thereby providing more relevant rankings.The application of standardized links can avoid duplicate content issues caused by URL parameters, pagination, etc., and concentrate page authority.As website operators, we should regularly review and adjust TDK to ensure consistency with the latest content, marketing activities, and SEO trends, thereby maximizing the potential of Anqi CMS in search engine optimization.
Frequently Asked Questions (FAQ)
Why did I set TDK in the background, but the front page of the website did not display or displayed incorrectly?This usually has several reasons. First, make sure that your template file uses the tags correctly.tdkFor example, use the tags to call this information, such as<title>{% tdk with name="Title" siteName=true %}</title>Next, if the TDK is set on the content page (such as articles, categories), please check whether the changes have been saved on the corresponding content editing page in the background.Finally, check if the website has enabled caching. If caching is enabled, you may need to clear the system cache to make the changes take effect.
How does AnQi CMS handle the priority of TDK for different pages, such as when there is a conflict between article TDK and category TDK?The TDK settings of Anqi CMS follow a strict priority.For specific content detail pages, such as article detail pages, the priority of the self-configured 'SEO title', 'document keywords', and 'document description' is highest.If not set, the system will trace up, possibly using the TDK of its category, or ultimately using the global homepage TDK setting of the website.For list pages (such as category lists, tag lists), the TDK information configured in the background will be used.This hierarchical structure ensures that we can fine-tune the TDK for each page, avoiding unnecessary conflicts.
What are the specific benefits of adding the website name in TDK for SEO?There are several benefits to adding the website name to the page title. Firstly, it helps with brand exposure and recognition, and seeing a familiar brand name in search results can increase the trust in clicks.Secondly, for user experience, it allows users to clearly know which website the current page belongs to.From an SEO perspective, it strengthens the brand keywords of the website to some extent and helps to improve the ranking of brand words in some long-tail searches.Passing of AnQi CMS{% tdk with name="Title" siteName=true %}It provides a convenient and unified way to manage this practice.