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:
- 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. - 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. - Incorporate brand elements and hierarchy:
- To incorporate brand elements in the title, you can
siteNamethe 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.
- To incorporate brand elements in the title, you can
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:
- Prioritize the specific keywords of the page:In the editing interface of documents, categories, single pages, or tags, the keywords you fill in will become
tdkThe label is displayed first. This allows you to configure the most relevant keyword group for each page. - 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:
- 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. - 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 %}