How to display a custom SEO title on the article detail page instead of the article title?

Calendar 👁️ 79

In content operation, setting the title of the website article detail page is a key link. We often encounter such situations: the content title of the article itself needs to be eye-catching, creative, to attract readers' clicks; while the page title required for search engine optimization (SEO) (i.e., the displayed in the browser tab)<title>The content of the tag), it is more focused on the layout of keywords, length control, and the friendliness to search engines.In AnQiCMS, you can fully flexibly manage these two different titles, ensuring both user experience and SEO effects without any compromise.

How to implement custom SEO title in AnQiCMS

AnQiCMS fully considered the needs of SEO optimization and provided an independent "SEO title" field for each article.This means you can set a title for the article to be displayed to readers, as well as a separate SEO title for search engine inclusion and display.

When you edit or publish an article, just pay attention to the 'Other Parameters' collapse area at the bottom of the page.Expand this area, and you will see an input box named "SEO Title".This field is exactly where AnQiCMS customizes the SEO title settings for your article detail page.Enter a carefully optimized title that will be used when the page is indexed by search engines as<title>The content of the tag, while the "Document Title" you set at the top of the article will be as the page content in<h1>the title for users to read.

Call custom SEO title in template

To correctly display this custom SEO title in the article detail page's HTML header, we need to use the powerful template tags provided by AnQiCMS. Usually, the template file for the article detail page would be{模型table}/detail.htmlOr you can specify a custom template for this article in the background.

AnQiCMS provides a namedtdktag, used specifically to manage the page.title/descriptionandkeywordsThese SEO core elements. UsetdkThe tag calls the SEO title very intuitively:

<title>{% tdk with name="Title" %}</title>

This code will intelligently retrieve the SEO title of the current article.If you enter content in the "SEO Title" field of the article, it will display your custom SEO title first;If not filled in, the system will fallback to using the document title itself, or other preset TDK logic, to ensure that the page always has a valid title.

Furthermore,tdkTags also provide flexible parameters, allowing you to better control the display of the title. For example, automatically adding your website name at the end of the SEO title is very helpful for brand exposure and recognition:

<title>{% tdk with name="Title" siteName=true %}</title>

tositeNamethe parameter totrueYour page title will automatically be added after the SEO title, usually followed by a hyphen-separated (default separator). If you want to change the separator, you can usesepparameters:

<title>{% tdk with name="Title" siteName=true sep="_" %}</title>

So, your SEO title and website name will be separated by an underscore_Make a connection.

In addition to the SEO title, we strongly recommend that you also go throughtdkThe tag is inheadRegional introduction article keywords and descriptions, this information can also be set in the "Other parameters" on the article editing page:

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

Complete example

Integrate the above template code snippet into your article detail pageHTMLof<head>Part, the header structure of a typical article detail page may look like this:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    {# 使用tdk标签动态生成SEO标题,并自动带上网站名称,以短横线分隔 #}
    <title>{% tdk with name="Title" siteName=true sep=" - " %}</title>
    {# 使用tdk标签动态生成页面关键词 #}
    <meta name="keywords" content="{% tdk with name="Keywords" %}">
    {# 使用tdk标签动态生成页面描述 #}
    <meta name="description" content="{% tdk with name="Description" %}">
    {# 引入CSS样式文件,这里使用的是系统提供的模板静态文件地址标签 #}
    <link rel="stylesheet" href="{% system with name="TemplateUrl" %}/css/style.css">
    {# 可以在此处添加其他SEO优化标签,如canonical链接等 #}
    {%- tdk canonical with name="CanonicalUrl" %}
    {%- if canonical %}
    <link rel="canonical" href="{{canonical}}" />
    {%- endif %}
    {# 网站的实际文章标题,通常作为页面内容的核心H1标签 #}
</head>
<body>
    <article>
        <h1>{% archiveDetail with name="Title" %}</h1> {# 这里的Title是文章的原始标题,用于内容展示 #}
        {# 接下来是文章正文内容,可以使用 archiveDetail 的 Content 字段 #}
        <div>
            {% archiveDetail articleContent with name="Content" %}
            {{ articleContent|safe }}
        </div>
        {# 其他文章详情元素,如发布时间、作者等 #}
    </article>
    {# 页面底部内容 #}
</body>
</html>

With the above configuration, your security CMS article detail page can achieve search engine-friendly custom SEO titles, while maintaining the reading attractiveness of the article itself, bringing better effects to your content operation.

Frequently Asked Questions (FAQ)

  1. Why is my article detail page<title>Why is the tag still showing the article title instead of the SEO title?This is usually due to two reasons: one, you may have forgotten to fill in the 'SEO Title' field in the 'Other Parameters' on the article editing page; two, your template file (usually{模型table}/detail.htmlOr a custom template is not used{% tdk with name="Title" %}Use the tag to call the SEO title. Please check these two places to ensure that the SEO title has been set and the template calling method is correct.

  2. Is there a limit to the number of characters in a custom SEO title?AnQiCMS system itself does not have a strict word limit for SEO titles, but in order to achieve the best search engine display effect and user experience, we strongly recommend that you control the SEO title within the limit of **60-70 characters (about 30-35 Chinese characters)within. A long title may be truncated on the search results page, affecting the delivery of complete information.

  3. Can't categories and single pages also be set with custom SEO titles?Yes, AnQiCMS also supports setting custom SEO titles for categories and single pages. When editing categories or single pages, you will find similar 'other parameters' or direct 'SEO title' fields, where you can fill in the content, and then use it in the corresponding category list page or single page detail page template.{% tdk with name="Title" %}Call the tag. This ensures that all key pages of your website's SEO titles can be managed in fine detail.

Related articles

How to use the `length` filter to get the length of a string, array, or key-value pair for display or judgment

In website content operation, we often encounter scenarios where we need to obtain or judge the length of data.For example, displaying the number of words in an article, the number of items in a list, or deciding whether to display an element based on the content length.AnQiCMS's template engine provides a series of practical filters to help us meet these needs, among which the `length` and `length_is` filters are the best.They can help us easily achieve these functions, making the dynamic display and interaction logic of the website more flexible.

2025-11-07

How to use the `contain` filter in AnQiCMS template to determine whether a string or an array contains a specific keyword?

During the process of building a website on AnQiCMS, flexibly displaying information according to the characteristics of the content is the key to improving user experience and operational efficiency.To achieve this, the system has built-in many practical template filters, among which the `contain` filter is a powerful tool for determining whether the content contains specific keywords.It can help you match content directly at the template level without modifying the backend code, thereby making your website content display more intelligent and personalized.

2025-11-07

How to retrieve and display a list of documents under a specified Tag, and support pagination?

In website content management, categorizing and displaying documents according to their tags (Tags) is an important strategy to enhance user experience and content discoverability.AnQiCMS provides a set of intuitive and powerful template tags that help us easily achieve this goal, while also supporting flexible pagination functionality, even when faced with massive amounts of content, it can maintain the page's cleanliness and loading speed.

2025-11-07

How to display a multi-level nested category list in AnQiCMS, such as top-level categories and their subcategories?

When building a website, a clear and organized content structure is the foundation for improving user experience and search engine optimization.Especially for content-rich websites, how to efficiently display multi-level nested category lists, such as top-level categories and their subcategories, is a concern for many operators.AnQiCMS is a flexible enterprise-level content management system that provides intuitive and powerful template tags, allowing you to easily meet this requirement.

2025-11-07

How to configure URL rewrite rules in Anqi CMS to optimize search engine crawling?

In website operation, Search Engine Optimization (SEO) plays a crucial role, and a friendly URL structure is a key factor in improving the performance of a website in search engines.A clear and meaningful URL not only helps search engines better understand the content of the page, but also allows visitors to see the theme of the page at a glance, enhancing the user experience.Traditional dynamic URLs often contain parameters that are difficult to understand, which is not friendly to SEO and users.Fortunately, AnQi CMS provides a powerful static rule configuration function, allowing you to easily optimize the URL structure of your website.

2025-11-07

How to display the multi-language content switch button on the website front end?

On AnQiCMS, it is crucial to display a multilingual content switch button on the website front-end to expand the global user base and enhance the user experience.AnQiCMS with its powerful multilingual support and flexible template mechanism makes implementing this feature intuitive and efficient. ### AnQiCMS multilingual mechanism overview AnQiCMS considered the needs of global content publishing from the outset.Its multilingual support is centered around the "multi-site management" feature.This means that you can create different sites to represent different language versions. For example

2025-11-07

Where is the TDK (Title, Keywords, Description) information of the home page set and displayed?

The TDK (Title, Keywords, Description) information on the homepage is crucial for the performance of the website in search engines.It is not only the key for search engines to understand the core content of a website, but also an important basis for users to decide whether to click on a website in the search results page.AnQi CMS is an efficient content management system that provides an intuitive and convenient TDK management function, allowing us to easily optimize the visibility of the website homepage in search engines.

2025-11-07

How to customize the template layout of article, product, and category pages?

In AnQi CMS, flexibly customizing the page template layout is a key step to enhancing website personalization and user experience.Whether it is an article, product detail page, or category list page, AnQi CMS provides powerful and intuitive tools to allow you to create unique and stylish pages without delving into programming.Let's explore how to bring your design concept to life in Anqi CMS.

2025-11-07