In website operation, we often encounter the situation where content repeats under different URLs.For example, a product may have multiple colors, and each color generates an independent page, but their core content is the same.Or, in order to track traffic, websites may add various parameters to the URL.This content is repeated, although it has little impact on user experience, it may confuse search engines, not knowing which one is the 'original version', which may affect the crawling efficiency and ranking of the website.

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

AnQiCMS as a system focusing on enterprise-level content management, is deeply aware of the importance of SEO optimization.It took into consideration the specification of link settings from the beginning, allowing users to conveniently manage this critical SEO element.


In AnQiCMS background configuration specification link

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 are creating a new "article" or a "product", in the "other parameters" section of the editing page, you will find a field named "Standard linkThe field in question is used to specify the standard URL of the current page.

How do you fill in this field?

You need to enter one here.The complete URL, and must includehttp://orhttps://Prefix. For example, if your article's final authoritative link ishttps://www.yourdomain.com/article/your-awesome-article, then you should fill in the address completely.

When do you need to set it?

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

However, in some specific scenarios, proactively setting the normative link can be very beneficial:

  • When there are multiple URLs pointing 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.
  • Joint publication or reproduction of content:If you publish original content on your website to other platforms, or republish content from other platforms, and you want search engines to know that the version on your website is the 'original version', you can set the URL of your website to the canonical link.This is especially common on some foreign trade websites or information release sites.
  • URL with parameters:When the session ID, tracking code (such as?utm_source=...), and filter conditions (such as?color=redWhen using parameters such as ,these URLs may have the same content, but they are considered different pages by search engines. At this time, you can set the base URL without parameters as the standard link.

Display standard link in template

Set the background field, and then we need to ensure that the website's frontend page can correctly convey this information to the search engine. The standard link is usually through the HTML page.<head>area.<link rel="canonical">Tags are implemented.

AnQiCMS provides a very convenient.tdk(Title, Description, Keywords) tag, we can use it to get page TDK information, including standard links.

In your template file (for examplebase.html,This is the common header file for many websites)of<head>In the region, 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 pageCanonicalUrlAssign it to a variable namedcanonical.
  2. Next, a{% if canonical %}Conditional judgment will checkcanonicalIf the variable has a value.
  3. Only whencanonicalThe variable has a value (i.e., you have entered content in the "standard link" field in the backend) when it will be output in HTML<link rel="canonical" href="您的规范链接" />this tag.

The benefits of doing this are that it only displays 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 application

Using the link correctly is an important factor in improving the website's SEO.It can not only help search engines crawl and index your content more efficiently, but also prevent the weight dispersion and ranking decline caused by duplicate content.

  • Unified page weight:Imagine that you have five URLs all pointing to an article about 'AnQiCMS features'.If there is no standard link, search engines may distribute the weight of these five pages, resulting in each page performing averagely.Set the link standard, and all weights will be concentrated on the 'authoritative' page you specify, thereby improving its ranking.
  • Avoid false judgments of content plagiarism:If your website content is heavily copied by other sites, search engines may mistakenly think that your content is plagiarized.By setting the standard link and ensuring that the external转载 page also uses the standard link pointing to your website, the original source of the content can be clearly identified.
  • Simplify web crawler extraction:The crawling resources of search engine spiders are limited.When multiple URLs point to the same content, they may waste resources in crawling and analyzing all duplicate pages.The规范链接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, making your website have a clearer and more authoritative image in search engines.


Common Questions (FAQ)

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

Q2:Can I set the specification link to point to a URL outside of my website?A2:Yes, it is technically permitted.If you have released content with a partner or if your content is the "original" version on another authoritative website, you can indeed point the specification link to an external URL.internal websiteThe duplicate content issue, or declare that your website is the original source of the content. If it points to an external page, it means you are telling the search engine that the external page is the authoritative version.

Q3:规范链接标签应该放在HTML页面的哪个位置?A3:规范链接(<link rel="canonical" href="..." />)标签必须放置在HTML文档的<head>Some content. If placed elsewhere, the search engine may ignore it or may not be able to identify it correctly.