The web page title (Title) is the 'face' of a website on the search engine results page, it not only can directly tell users the content of the page, but also is an important indicator for search engines to evaluate the relevance and authority of the page.A well-optimized page title that can significantly improve click-through rates and the website's search engine ranking.In AnQiCMS, you can very flexibly control the generation of page titles, especially when dynamically adding the website name suffix and custom delimiters to achieve a unified brand image and better SEO effect.

AnQiCMS in TDK (Title, Description, Keywords) management

In AnQiCMS website operation, the title (Title), description (Description), and keywords (Keywords) are the core elements of page SEO.AnQiCMS provides multi-level TDK settings, allowing you to finely control the title of each page.

Generally, the basic title of the page comes from the following aspects:

  • Content pages (articles, products, single pages, tag pages)When editing this content, you can set the 'SEO Title' field separately for each page. This field has the highest priority.
  • Category PageWhen managing categories, you can set 'SEO title' for each category.
  • HomeIn the background 'Home page TDK settings', you can set the title, keywords, and description for the home page of the website.

When these 'SEO title' fields are empty, the system will default to using the title of the content, the category name, or the single page name as the basic title of the page. In the AnQiCMS template, the core tool for managing page titles istdkLabel. This label will automatically retrieve the most appropriate title content based on the context of the current page (such as article detail page, category list page, or home page).

Add a website name suffix dynamically

To maintain brand consistency and make it easier for users to identify your website in search engine results, it is usually necessary to add the name of the website as a suffix at the end of each page title.Manually adding a suffix to each page is not only tedious but also prone to errors.AnQiCMS provides a very convenient mechanism to automate this process.

You can add it in the template of<title>Use within tagstdktags, and by adding to itsiteName=trueThe attribute indicates that the system will automatically append the website name you set in the background as a suffix to the page title.This website name comes from the 'Website Name' field in the 'Global Settings' of the backend.

For example, your template file (usuallybase.htmlor in the header file of each page)titleset the tag as follows:

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

When you set the 'Website Name' to 'AnQiCMS' in the background 'Global Settings' and the title of an article page is 'AnQiCMS Function Deep Analysis', the actual title displayed in the browser tab and search engine results will be 'AnQiCMS Function Deep Analysis - AnQiCMS'.If the 'SEO title' field of the article is empty, then the article's own set title will be used, followed by the website name suffix automatically.

Custom delimiter

By default, AnQiCMS uses the hyphen "-" as a separator when concatenating page titles and website name suffixes. If you find that the default hyphen does not match your brand style, or if you want to use other symbols (such as the vertical bar "|" or underscore "_"), you can also do so bytdklabel'ssepCustomize the attribute.

For example, if you want to change the delimiter to pipe "|", you can modify your template code like this:

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

This will display the article title as: "AnQiCMS Function Deep Analysis | AnQi CMS".You can choose the appropriate delimiter flexibly according to your own preferences and website design specifications.

Integrated application and **practice

Combining the dynamic website name suffix and custom delimiter can build a powerful and unified page title generation rule. For example:

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

By doing so, you can ensure that all page titles follow a unified naming convention, which not only helps to enhance the professional image of the website but also greatly benefits search engine optimization (SEO).Search engines prefer pages with clear, consistent titles.

For categories or document detail pages, sometimes you may also want to include the name of the parent category in the title to provide richer contextual information.tdkTags also supportshowParent=trueattribute to achieve this:

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

Such, for example, in the detail page of an article under a subcategory, the title may be presented as: "Article Title - Subcategory Name - Parent Category Name - Website Name", thereby enhancing the descriptiveness and hierarchy of the title.

Points to note

  • Priority: When the 'SEO Title' field of the content itself has a value, the priority of this field is the highest.tdkThe tag will use this value first and apply it on top of that.siteNameandsepParameters. Only when the 'SEO title' is empty,tdkthe tag will generate the basic title according to the page type (article title, category name, single page name, etc.).
  • cacheAfter modifying the background settings (such as the website name) or template code, if the front-end page does not take effect immediately, remember to clean the system cache in time.The background usually has an option like 'Update Cache' or similar to perform this operation.

Through these flexible features provided by AnQiCMS, you can easily achieve professional page title management that meets SEO requirements, making your website more competitive in the digital world.


Frequently Asked Questions (FAQ)

Q1: Why did the settingsiteName=trueafter that, the page title of my website still does not show the website name suffix?

A:This may have several reasons: first, please make sure that your template includes<title>within the labeltdkthe tag actually containssiteName=trueThis property. Next, check whether the 'Website Name' field in the background 'Global Settings' has been filled in.If this field is empty, the system will not be able to add a suffix. Finally, don't forget to clear the system cache after modifying the background settings or template code to ensure that the changes take effect.

Q2: I only want to display the website name suffix on certain page types (such as article detail pages) and not on other pages. How do I do that?

A:AnQiCMS allows you to use different template files for different page types. You can only use the template files that show the website name suffix for specific page types (such asarchive/detail.htmlFor article detail pages, orcategory/list.htmlin category list pages<title>Use within tags{% tdk with name="Title" siteName=true %}. For pages that do not need to display the suffix, it can be omittedsiteName=trueattribute, or explicitly set it.siteName=false({% tdk with name="Title" siteName=false %}).

Q3: 'SEO Title' andtdkwhat is the relationship between tags? What is their priority?

A:The 'SEO Title' is an independent title setting for a single article, category, or page in AnQiCMS, it has the highest priority. When you fill in the 'SEO Title' while editing the content, thentdkThe label will prioritize using this set title. Only when the 'SEO Title' field on the content page is empty,tdkThe tag will generate a basic title based on the page itself (such as article title, category name, single page name) and apply it on top of thattdkas set in the tagsiteName(Website name suffix) andsep(Separator) and other parameters. In short, the priority of the 'SEO title' on the specific content page is higher thantdkthe dynamic generation rules of tags.