In website operation, optimizing search engine (SEO) is a key link to obtaining natural traffic.While TDK (Title, Description, Keywords) are the first impression of a page presented in search engine results, their 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 deeply understands the value of TDK for SEO, therefore it provides an extremely flexible and powerful "Universal TDK Tag" -tdk.The 'versatile' aspect of this label is 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.

Automatic recognition, generate personalized TDK on demand

Whether you are editing the article detail page, category list page, standalone single page, or even the tag page,tdkTags can intelligently extract and display the most suitable SEO information based on the specific content of the current page.It works by prioritizing the SEO fields you set for a specific page in the background. If these fields are not set, it will use the page's title, description, or system default settings as a supplement to ensure that each page has complete TDK information.

Page Title (Title): Precisely Convey the Core of the Page

of the page<title>Tags are the most direct signals for search engines to judge the theme of a page and are the first text users see in search results.tdkLabels will follow a set of intelligent logic when generating page titles:

  1. Page-specific SEO titles will be called first:When you have individually set the 'SEO Title' in the backend editing interface for articles, categories, single pages, or tags,tdkLabels will prioritize these personalized titles. This allows you to fine-tune the titles for each page to make them more aligned with search intent.
  2. Naturally fall back to the page title:If a page does not have a dedicated 'SEO title',tdkWill naturally 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. Integrate brand elements and hierarchy:
    • To integrate brand elements in the title, you cansiteNameparameter settingstrue, so the website name will be automatically 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 vertical line|.
    • especially on the category page, when you hope that the title can reflect the hierarchy,showParent=trueThen it can also display the parent category title, enhancing the contextual 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 topic

Keywords are important clues that tell search engines about the core content of a page.Although modern search engines have reduced the weight of Keywords, reasonable settings still help search engines better understand the page topic.tdkLabels will be:

  1. It will prioritize the specific keywords of the page:The keywords you fill in on the document, category, single page, or label editing interface will becometdkLabel priority content. This allows you to configure the most relevant keyword groups 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" %}">

页面描述(Description):吸引用户点击的摘要

The description (Description) of the page is the source of search engine results snippets and is also an important factor in attracting users to click.A well-written description can summarize the page content and stimulate user interest.tdk标签在处理页面描述时,同样体现了其智能性:

  1. 优先调用页面自定义简介: tdkThe label will first capture the "Document SummaryThese custom introductions are the marketing copy tailored for this page.
  2. Automatically extract content 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, usually about 150 characters, to ensure that the page always has descriptive information displayed, even if you forget to fill it in manually, the page will not appear empty in search results.

Example:

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

规范链接(CanonicalUrl):避免重复内容的利器

In SEO practice, the canonical URL is an important tool for solving duplicate content issues.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 penalties.

tdk标签同样能访问这个字段。为了避免页面上出现无效的canonicalLabels, we usually check if the standard link exists before outputting:

Example:

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

If the backend sets a standard link for the current page, it will be correctly added to the page header; otherwise, the tag will not be displayed.

Integrated Application: Incorporate TDK tags into the page header

Generally, we would 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 %}