In website operation, TDK (Title, Description, Keywords) plays a crucial role. They are the first window for search engines to understand the content of a website and directly affect the visibility and click-through rate of the website in search results.An optimally designed TDK can not only improve the website's SEO performance but also accurately convey the core value of the website to potential visitors.AnQiCMS as a content management system focusing on SEO optimization, provides users with a convenient and efficient way to set and manage the website's TDK on the homepage.
Next, we will learn how to set and display the TDK of the website homepage in AnQiCMS.
1. Set the TDK for the homepage in the AnQiCMS backend
AnQiCMS provides a dedicated TDK setting entry for the homepage, allowing you to centrally manage the portal information of the website.
- Navigate to the settings page:After logging into the AnQiCMS backend management interface, you will see the left navigation bar.Find and click the 'Home TDK Settings' option under the 'Background Settings' menu.This is where the TDK of the centralized management homepage is located.
- Fill in the content of each item:After entering the 'Home Page TDK Settings' page, you will see three core input boxes, which correspond to the three components of TDK:
- Home Page Title (Title):This is the most important title displayed in the browser tab and search engine results on the website homepage.Suggest you fill in the core brand name, main business or service of the website here, and complement with keywords to accurately summarize the content of the website.A good homepage title can attract user clicks and also inform search engines about what your website is about.
- Home Page Keywords (Keywords):Although modern search engines have reduced the weight of keywords, reasonable settings can still help search engines better understand the theme of your website. You can enter keywords highly relevant to the core business of the website here, and separate multiple keywords with English commas
,Separate it. Avoid stacking too many irrelevant keywords, maintaining relevance is the key. - Home Page Description (Description):This is usually the website summary displayed below the title in search engine results.A well-crafted homepage description can clearly articulate the services or products of the website, attracting users to learn more.It should be a natural and fluent text, containing core keywords, moderate in length, and able to stimulate the user's desire to click.
- Save settings:Please make sure to click the 'Save' or 'Submit' button at the bottom of the page after filling in, to ensure that your TDK settings take effect.
By following these steps, you have completed the configuration of the TDK on the AnQiCMS backend homepage. This information will be stored by the system and ready to be called on the frontend page.
Two, display the home page TDK in the front-end template
After setting up the background information, we need to ensure that these TDK contents are displayed correctly on the front-end pages of the website.AnQiCMS makes it very simple to call TDK data in templates through its powerful template tag system.
The TDK of the home page of the website is usually placed in the HTML file<head>As shown in the following example in the area
<!DOCTYPE html>
<html lang="zh-CN">
<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" %}">
<!-- 规范链接(可选,但强烈推荐) -->
{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}
<!-- 其他头部信息 -->
</head>
<body>
<!-- 网站内容 -->
</body>
</html>
Let us explain the TDK related tags used here one by one:
- Page Title (
<title>Tag):You can use{% tdk with name="Title" %}Translate the content of the JSON array as follows: The translation should strictly maintain the original JSON array format: 【en】:[{'key':0,'value':'Label to output the background settings “Homepage Title”. This label also has several practical parameters that can adjust the display of the title':}]]}]siteName=trueIf you wish to automatically append the site name to the title set in the background (for example: "My Home - AnQiCMS"), you can add this parameter.By default, the website name will not be automatically appended.sep="_"This parameter allows you to customize the separator between the title and the website name. For example, settingsep="_"the title will be displayed as “My Home_AnQiCMS”.- For example:
<title>{% tdk with name="Title" siteName=true sep=" - " %}</title>The title displayed on the page will be the title set in the background, connected with the website name using “ - ” as a separator.
- Page keywords (
<meta name="keywords" content="">Tag):It is very direct to call the “Home Keywords” set in the background, just in<meta name="keywords">TagscontentUsed in attributes{% tdk with name="Keywords" %}. - Page description (
<meta name="description" content="">Tag):Similar to keywords, you can use{% tdk with name="Description" %}tags to output the "home description" set in the back-end<meta name="description">Tagscontentin attributes. - Standard link (
<link rel="canonical">Tag):Although the normative link is not in the traditional sense of TDK, it is a very important part of SEO, used to indicate the preferred version of the current page to search engines and avoid content duplication issues. AnQiCMS also provides a convenient calling method:- First, use
{%- tdk canonical with name="CanonicalUrl" %}Assign the specification link address to a variablecanonical. - Then, through
{%- if canonical %}JudgmentcanonicalCheck if the variable has a value, if it does, then output<link rel="canonical" href="{{canonical}}" />Tags. This is a rigorous approach to avoid outputting empty standard link tags.
- First, use
Summary
With the intuitive backend settings and flexible template tags provided by AnQiCMS, you can easily configure and display TDK information for the homepage of your website.The correct TDK settings are the cornerstone of website SEO optimization, which can help your website gain better exposure on search engines and attract more targeted users.Remember that the value of TDK lies in its accuracy and relevance, always optimizing them in a user and search engine friendly manner.
Common Questions (FAQ)
1. I have set the homepage title in the background, but why is my website name not displayed after the page title?
Answer: The homepage title in AnQiCMS does not automatically append the website name by default. If you want the page title to include the website name, you need to usetdkAdd tags explicitly.siteName=trueFor example:<title>{% tdk with name="Title" siteName=true %}</title>After this setting, the system will automatically add the brand name of the website after the homepage title you set.
2. How are the TDK set and displayed on article detail pages or category pages, except for the homepage?
Answer: For non-homepage pages, AnQiCMS provides a more detailed TDK management method.On the 'Document Management' or 'Document Classification' editing page, you can find fields such as 'SEO Title', 'Keywords', and 'Summary' (usually as a description) for independent settings.tdkThe label will automatically identify the type of the current page and prioritize displaying the TDK information you set in the article or category.If the article or category has not been set separately, the system may automatically generate or use the default TDK based on the title, content summary, etc.
Can I directly hardcode the homepage's Title, Description, and Keywords in the template?
Answer: Although technically you can write directly in the HTML template<title>/<meta name="keywords">and<meta name="description">without using AnQiCMStdkTag, but this is not the recommended practice.Hardcoding makes TDK management inflexible. Each time a modification is needed, the template file must be edited, which increases the maintenance cost.The TDK setting function provided by AnQiCMS aims to allow you to easily modify and manage it on the backend interface without touching the code, which is more efficient and convenient for adjusting SEO strategies and daily operations.tdktags for management.