In website operation, TDK (Title, Description, Keywords) plays a crucial role, they are the first window through which search engines understand the content of the website, directly affecting the visibility and click-through rate of the website in search results.An optimized TDK can not only improve the SEO performance of the website, 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 TDK of the website homepage.

Next, we will learn in detail how to set and display the TDK of the website homepage in AnQiCMS.

1. Set the TDK of the homepage in the AnQiCMS background.

AnQiCMS provides a dedicated TDK setting entry for the homepage, allowing you to centrally manage the portal information of the website.

  1. Navigate to the settings page:After logging into the AnQiCMS backend management interface, you will see the left navigation bar.Under the "Background Settings" menu, find and click the "Home TDK Settings" option.This is where the TDK of the home page is centrally managed.
  2. Fill in the content:After entering the "Home TDK Settings" page, you will see three core input boxes, which correspond to the three components of TDK:
    • Home Title (Title):This is the most important title displayed in the browser tab and search engine results on the website homepage.Please fill in the core brand name, main business or service of the website here, and supplement with keywords, striving to accurately summarize the content of the website.A good homepage title can attract users to click and also tell search engines what your website is about.
    • Home page keywords (Keywords):Even though modern search engines have reduced the weight of keywords, a reasonable setup can still help search engines better understand the theme of your website. You can enter highly relevant keywords related to the core business of your website here, separated by English commas,Separate. Avoid堆积过多无关关键词,保持其相关性是关键。
    • Home Description (Description):This is typically the website summary displayed below the title in search engine results.A well-crafted homepage description clearly explains the services or products of the website, attracting users to learn more.It should be a natural and smooth text, containing core keywords, moderate in length, and able to stimulate user clicks.
  3. Save settings:After filling in, please be sure to click the "Save" or "Submit" button at the bottom of the page to ensure that your TDK settings take effect.

By following these steps, you have completed the configuration of AnQiCMS backend homepage TDK. This information will be stored by the system and ready to be called on the frontend page.

Second, 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 page of the website.AnQiCMS through its powerful template tag system makes it very simple to call TDK data in the template.

The TDK of the home page is usually placed in the HTML file<head>in the area, as shown in the following example:

<!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's explain each of the TDK-related tags used here:

  1. Page title (<title>Label):You can use{% tdk with name="Title" %}Label to output the homepage title set in the background. This label also has several practical parameters that can adjust the display of the title:
    • siteName=trueIf you want to automatically add the site name after the title set in the background (for example: "My Home - AnQiCMS"), you can add this parameter.By default, the website name is not automatically appended.
    • sep="_"This parameter allows you to customize the separator between the title and the website name. For example, setsep="_"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 “ - ” and the website name.
  2. Page keywords (<meta name="keywords" content="">Label):Call the "home page keyword" set in the background very directly, just need to<meta name="keywords">label'scontentuse in the properties{% tdk with name="Keywords" %}Just do it.
  3. Page description (<meta name="description" content="">Label):Similar to the keywords, you can use{% tdk with name="Description" %}Label to output the 'home description' set in the background, place it at<meta name="description">label'scontentthe attribute.
  4. Standard link (<link rel="canonical">Label):Although the standard link is not a traditional TDK, it is an important part of SEO, used to indicate the preferred version of the current page to search engines, to avoid duplicate content issues. AnQiCMS also provides a convenient calling method:
    • First, use{%- tdk canonical with name="CanonicalUrl" %}Assign the standard link address to a variablecanonical.
    • Then, through{%- if canonical %}the judgment.canonicalCheck if the variable has a value, if it exists, then output<link rel="canonical" href="{{canonical}}" />Label. This is a strict practice to avoid outputting empty standard link labels.

Summary

Through the intuitive backend settings and flexible template tags provided by AnQiCMS, you can easily configure and display TDK information on the website homepage.The correct TDK settings are the foundation of website SEO optimization, which can help your website gain better exposure on search engines and attract more target users.Remember, the value of TDK lies in its accuracy and relevance, always optimizing them in a user and search engine friendly manner.

Frequently Asked 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: In AnQiCMS, the home page title is not automatically appended with the website name by default. If you want the page title to include the website name, you need to use it in the template.tdkWhen labeling, explicitly addsiteName=trueParameters. For example:<title>{% tdk with name="Title" siteName=true %}</title>After this setting, the system will automatically add the brand name of the website to the title of the homepage you set.

2. How are the TDK settings and display on article detail pages or category pages set up, besides the homepage?

Answer: For non-homepage pages, AnQiCMS provides a more detailed TDK management method.On the editing page of "Document Management" or "Document Classification", you can find fields such as "SEO Title", "Keywords", and "Summary" (usually as a description) to set independently.When you visit these pages,tdkThe tag automatically identifies the type of the current page and displays the TDK information you set in the article or category first.If the article or category is not set separately, the system may automatically generate or use the default TDK based on the title, content abstract, etc.

Can I hardcode the Title, Description, and Keywords of the homepage in the template?

Answer: Although technically you can write directly in the HTML template<title>/<meta name="keywords">and<meta name="description">without using AnQiCMS'stdkLabels, but this is not the recommended approach. Hardcoding makes TDK management inflexible, and each time a modification is needed, the template file must be edited, increasing maintenance costs.The TDK setting feature provided by AnQiCMS allows you to easily modify and manage it in the background interface without touching the code, which is more efficient and convenient for adjusting SEO strategies and daily operations.Advise you to make full use of the system providedtdkManage tags.