In website operation, we often encounter situations where content is similar or duplicated, which may not only scatter the search engine crawling budget, but also dilute the page weight, affecting the SEO performance. 幸运的是,AnQi CMS has provided us with the function to set the canonical link (Canonical URL), which can effectively help us solve these problems, clearly telling search engines which page is the "original" or "preferred" version of the content.

Understanding the value of the canonical URL

In simple terms, a canonical link is like a 'home page signpost' for search engines. When multiple URLs point to pages with very similar or identical content on your website, for example:

  • There are multiple colors for the same product, each color corresponds to a URL, but the core product description is mostly consistent.
  • The article is categorized under multiple different categories, resulting in different URL paths but the same content.
  • The page URL includes tracking parameters (?utm_source=...), causing multiple parameterized URLs on the same page.
  • Pages with consistent content but different URLs are used on different devices (such as PCs and mobile phones) if the website is not adaptive or code adaptation mode is not enabled.

In this case, if not explicitly specified, the search engine may be confused about which page is the 'authoritative' version, and may even misjudge it as duplicate content and lower the rankings of all related pages.Set the standard link to avoid this kind of confusion, ensure that the search engine can accurately understand the structure of your website, and concentrate all related signals (such as link weight, ranking signals) on the homepage you specify.

Set the standard link in the Anqi CMS backend.

The design of Anqi CMS fully considers SEO requirements, the process of setting up standard links is very intuitive.

When editing or publishing a new article, product, or single page, you can find a dedicated field to configure standard links.As a rule, at the bottom of the content editing page, you will see a collapsible area named "Other Parameters".Click to expand this area and find the item "Canonical URL".

Here, you need to enter the complete URL of the page you want the search engine to consider as the main version. This link must end withhttp://orhttps://starts and is a directly accessible complete address, for examplehttps://en.anqicms.com/article/98.If you want the current page to be recognized as the original page by search engines, it is usually best to leave it blank, and the system will default to using the URL of the current page as the standard link.But if the content on the current page is copied from other sources (such as external websites) and you want the search engine to pass on the weight to the original author's website, or if your page is indeed a variant of some "main page", then this is the place to specify the main page URL.

Ensure that the standard link is displayed correctly on the page

The link set in the background is not enough, we need to ensure that this link can be displayed correctly in the HTML code of the web page, so that the search engine spiders can read it.The Anqi CMS uses template tags to allow us to flexibly output this information on the website front-end.

In the template files of the website, we use{% tdk %}Tags to handle the TDK (Title, Description, Keywords) information on the page, and standard links also belong to this kind of important<head>Tag content.

Generally, the header template file of a website (such asbase.htmlor the public header file referenced by the article/product detail page) is where such global information is placed<head>The ideal position for a label. In this file,<head>you can add the following code to call the specification link:

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

It is worth noting that we used{%- tdk canonical with name="CanonicalUrl" %}This way to define a variable namedcanonicalIt will fetch the value of the "standard link" set in the background. Then, we use{%- if canonical %}to make a judgment. Only whencanonicalThis variable has a value (i.e., you have set specific specifications for this page in the background) when,<link rel="canonical" href="{{canonical}}" />this line of HTML code will be output to the page.

The benefits of doing this are multifaceted:

  1. Code concise:Avoids outputting empty on pages without a specified link<link rel="canonical">Tags, keeping the HTML code neat.
  2. Accuracy:Ensured that only when you explicitly specify the specification link, the search engine will see and follow your instructions.
  3. Follow **Practice:**This is a commonly recommended practice in the SEO field, which can effectively avoid potential misunderstandings.

By following these steps, you not only specified the standard link of the page in the Anqi CMS backend, but also ensured that it could be correctly identified and applied by search engines, thereby optimizing the performance of your content in search results and consolidating the page authority.


Frequently Asked Questions (FAQ)

1. If I haven't specifically set a standard link, how will AnQi CMS handle it?

If you do not manually fill in the 'standard link' for a page in the 'other parameters' section of the background, AnQi CMS will usually default to using the URL of the current page as its own standard link.This means that in most cases, the search engine will still consider the current page to be the original version of the content.Although this is a reasonable default behavior, when encountering pages with highly similar content or multiple URL parameters, manual settings can provide more precise control and stronger signals, avoiding potential confusion for search engines.

2. What is the difference between a standard link and a 301 redirect, and how should I choose?

The canonical URL isRecommendedIt tells the search engine which URL is the preferred version, but the search engine retains the final decision-making authority.Pages that are similar in content but cannot be redirected simply are usually used, such as print versions, URLs with tracking parameters, or products with slight variations but consistent main content.MandatoryIt tells the browser and search engines that the page has permanently moved to a new address, and will direct both users and search engines to the new URL.301 is used for situations where the page URL has a permanent change (such as website redesign, page deletion and merging).Choose the method that suits your specific needs: if the content still exists in multiple URLs but you want to concentrate the weight, choose the standard link; if the content has been completely transferred from the old URL to the new URL, choose 301 redirect.

Can the canonical URL point to a page on an external website?

Technically, it is possible.If you publish content on Anqi CMS that is转载自 other websites, and you want search engines to know the original source and direct weight to the original author's website, you can fill in the external website URL in the standard link.This is very useful in content distribution and copyright attribution.Your websiteThe internal URL to consolidate the weight and ranking of your own website.Unless you have a specific purpose (such as declaring转载or participating in content co-publication), it is generally not recommended to link specifications to external websites.