How to display the AnQiCMS page's canonical URL?

Calendar 👁️ 59

In website operation, we often encounter the situation where content appears repeatedly under different URLs.For example, a product may have multiple colors, each color generating an independent page, but their core content is the same.Or, websites may add various parameters to URLs to track traffic.This 'duplicate' content, although it has little impact on user experience, but it may confuse search engines, not knowing which is the 'original version', thereby possibly affecting the website's crawling efficiency and ranking.

This is where the 'Canonical URL' comes into play.It is like a lighthouse that guides search engines, telling them: 'Hey, these pages that look similar actually point to the same authoritative version.'By setting up standard links, we can effectively solve the problem of duplicate content, concentrate page authority, optimize search engine crawling, and improve the website's SEO performance.

AnQiCMS as a system focusing on enterprise-level content management, deeply understands the importance of SEO optimization.It considered the setting of standard links from the beginning, allowing users to conveniently manage this key SEO element.


Configure the specification link on the AnQiCMS backend

In AnQiCMS, setting up standard links for your page is a direct and practical process. The main operations are completed in the interface where you publish or edit documents.

When you enter the AnQiCMS backend, whether you create an article or a product, in the "Other Parameters" section of the editing page, you will find a name calledStandard linkThe field. This field is used to specify the standard URL of the current page.

How to fill in this field?

You need to enter one hereComplete URLand must includehttp://orhttps://Prefix. For example, if the ultimate authoritative link of your article ishttps://www.yourdomain.com/article/your-awesome-articlethen you should fill in this address completely.

When do you need to set it?

In most cases, if your website does not have a lot of duplicate content, or the URL structure itself is already clear enough, then this field can be left blank.AnQiCMS can handle it on most occasions, or search engines can also understand it.

However, in certain specific scenarios, proactively setting up a canonical link is very beneficial:

  • When multiple URLs point to the same content:For example, if your website has different paths/product/item-idand/products/item-nameCan access the same product page, at this time you can choose one as the standard URL.
  • Content joint publication or reprint:If you publish original content on other platforms or republish content from other platforms and want search engines to know that the version on your website is the 'original version', you can set the URL of your website as the standard link.This is particularly common on some foreign trade websites or information release sites.
  • URL with parameters:When the URL contains a session ID, tracking code (such as?utm_source=...), filter conditions (such as?color=redWhen parameters are included, these URLs may be identical in content, but they are considered different pages by search engines. In this case, you can set the base URL without parameters as the canonical link.

Display specification link in template

After setting the background field, we also need to ensure that the front-end page of the website can correctly convey this information to search engines. The standard link is usually through the HTML page of<head>the area within<link rel="canonical">Tagged to implement.

AnQiCMS provides a very convenienttdk(Title, Description, Keywords) tag, it can be used to obtain page TDK information, including standard links.

In your template file (for examplebase.htmlThis is the common header file for many websites) of<head>In the area, you can call and display the standard link in this way:

{%- tdk canonical with name="CanonicalUrl" %}
{%- if canonical %}
<link rel="canonical" href="{{canonical}}" />
{%- endif %}

The meaning of this code is:

  1. Firstly, it will try to usetdktag to get the current page'sCanonicalUrlAssign the value to a variable namedcanonical.
  2. Then, a{% if canonical %}Conditional judgment will checkcanonicalif the variable has a value.
  3. Only whencanonicalA variable has a value (i.e., you have filled in the content of the "standard link" field in the background) when it is output in HTML<link rel="canonical" href="您的规范链接" />this tag.

The benefit of doing this is that it will only display on the page when you actually specify a standard link for a certain page, avoiding unnecessary empty tags and making the code cleaner and more efficient.


Considerations in practical applications.

Using the specification link correctly is an important factor in improving the SEO effect of a website.It not only helps search engines crawl and index your content more efficiently, but also prevents weight dispersion and ranking decline due to duplicate content.

  • Uniform page weight:Imagine that you have five URLs pointing to an article about the "AnQiCMS features".If there is no standard link, the search engine may distribute the weight of these five pages, resulting in each page performing averagely.After setting the standard link, all weights will be concentrated on the 'authoritative' page you specify, thereby improving its ranking.
  • Avoid misjudgment of content plagiarism:If your website content is widely copied by other sites, search engines may mistakenly believe that your content is plagiarized.By setting the specification link and ensuring that the external转载 pages also use the specification link pointing to your website, the original source of the content can be clearly identified.
  • Simplify web crawler extraction:The resources of search engine crawlers are limited. When multiple URLs point to the same content, they may waste resources in crawling and analyzing all duplicate pages.Standard links can guide crawlers to directly access authoritative pages, improving the efficiency of crawling.

Through the intuitive backend settings and flexible template tags provided by AnQiCMS, you can easily manage standard links and give your website a clearer, more authoritative image in search engines.


Frequently Asked Questions (FAQ)

Q1: If I haven't set a canonical link for the page, will AnQiCMS automatically generate one?A1: AnQiCMS itself will not automatically generate one.<link rel="canonical">Label. If you leave the 'Standard Link' field blank in the background, and the conditional judgment code mentioned above is used in the template, then the label will not be displayed on the page.In this case, the search engine will judge which URL is the standard version according to its own algorithm.Although most of the time search engines can make reasonable judgments, manual settings can provide clearer instructions, thereby better controlling SEO.

Q2: Can I set the specification link to point to a URL outside my website?A2: Yes, it is technically permissible. If you have released content in partnership with a partner, or if your content is the 'original' version on another authoritative website, you can indeed link the specification to an external URL.But in most cases, the normative link is to solve for youInternal websiteDuplicate content issues, or declare that your website is the original source of the content. If it points to the outside, it means you are telling the search engine that the external page is the authoritative version.

Q3: Where should the specification link tag be placed on the HTML page?A3: The specification link (<link rel="canonical" href="..." />) tag must be placed in the HTML document's<head>Part of it. If placed elsewhere, the search engine may ignore it or fail to recognize it correctly.

Related articles

How to correctly configure the pseudo-static rules in AnQiCMS to generate URLs that are friendly to users and search engines?

In website operation, a URL structure that is friendly to both users and search engines is crucial.It not only allows visitors to understand the page content at a glance, but also makes it convenient for search engines to crawl and understand your website, which directly affects the SEO performance and user experience of your website.AnQiCMS (AnQiCMS) knows this well, therefore it is built with powerful pseudo-static features, allowing you to easily customize the URL of your website.Next, we will explore how to correctly configure the pseudo-static rules in AnQiCMS to generate those beautiful and practical URLs.

2025-11-07

How to use AnQiCMS built-in TDK tags to dynamically set page SEO information?

As an experienced website operator, I am well aware of the importance of Search Engine Optimization (SEO) for website visibility and traffic growth.In SEO work, the reasonable setting of TDK (Title, Description, Keywords) tags is undoubtedly the cornerstone of the cornerstone.A clear and accurate TDK that can not only help search engines better understand the page content, but also attract users to click on the search results.

2025-11-07

How to use the Canonical URL feature of AnQiCMS to avoid content duplication display issues?

In website operations, we often encounter a tricky problem: content duplication.This does not refer to manually copying and pasting the article, but rather to the fact that the same content can be accessed through multiple different URL addresses due to various technical reasons.For search engines, this can cause confusion, as they are not sure which URL is the official version of the content, which may scatter the ranking weight of the page, reduce the efficiency of the crawler, and even affect the overall SEO performance of the website.Luckyly, AnQiCMS provides a powerful and convenient feature——Canonical

2025-11-07

How to configure the page Title, Keywords, Description of AnQiCMS to optimize search engine display?

In website operation, making your content stand out in search engines is a key step to gaining traffic.And the page title (Title), keywords (Keywords), and description (Description), which we often call TDK, are important elements for communicating with search engines.AnQiCMS is a system focused on enterprise content management, fully aware of the value of TDK configuration for SEO, and therefore provides flexible and powerful functions to help us easily optimize the display of our website in search engines.### Why is TDK configuration so important

2025-11-07

How to perform addition of numbers and strings in AnQiCMS template and display the result?

When building dynamic content in AnQi CMS templates, it is often necessary to perform simple calculations and concatenations of numbers or strings.Whether it is to display the cumulative user points or to combine and display product codes with specific prefixes, Anqi CMS provides a flexible and convenient way to meet these needs.This article will deeply explore how to perform addition operations in the AnQiCMS template, and provide detailed examples and practical suggestions.### Understanding the computational capabilities of AnQi CMS template The AnQi CMS template system is based on syntax similar to the Django template engine

2025-11-07

How to use AnQiCMS filter to display strings centered or aligned to a specified length?

In website content display, we often need to format text to make it more beautiful and tidy in layout, especially in lists, tables, or areas that require a unified visual effect.AnQiCMS (AnQiCMS) powerful template engine provides a variety of practical filters (filters) that can help us easily achieve centered, left-aligned, or right-aligned strings and can be filled to a specified length.

2025-11-07

How to judge whether a string or array contains a specific keyword and display the result in AnQiCMS template?

When building and managing website content, we often encounter such needs: to decide whether to display a "hot" tag based on whether the article title contains a certain keyword; or check whether a certain feature is mentioned in the product description to adjust its display style.These seemingly subtle dynamic adjustments can greatly enhance the intelligence and user experience of the website.In AnQiCMS, due to its flexible Django template engine syntax, implementing such judgments is not complicated.

2025-11-07

How to calculate the number of occurrences of a specific keyword in the AnQiCMS template string or array?

In daily website operations, we often need to analyze and manage content in detail.One common requirement is to count the number of occurrences of a specific keyword in a string or array within a website template.It is very helpful to understand how to implement this feature in AnQiCMS templates, whether it is for optimizing SEO keyword density, analyzing content hotspots, or for dynamically displaying relevant information on the page.AnQiCMS benefits from its powerful and flexible Django-style template engine, providing rich built-in tags and filters, making these operations extremely simple.

2025-11-07