In website operation, we often encounter a tricky problem: content repetition.This does not mean that you manually copied and pasted the article, but rather that due to various technical reasons, the same content can be accessed through multiple different URLs.For search engines, this may cause confusion, as they are unsure which URL is the 'official' version of the content, which may分散页面的排名权重, reduce the efficiency of web crawlers, and even affect the overall SEO performance of the website.幸运的是,AnQiCMS提供了一个强大而便捷的功能——Canonical URL(规范网址),能够有效解决这一问题。

Understand the repetition of content and its dangers

Content is duplicated, as the name suggests, it means that there are multiple URLs pointing to the same or extremely similar content on a website. This situation may occur in many scenarios:

  • URL parameter changes:比如,通过会话ID(English)example.com/page?sessionid=123)、追踪参数(English)example.com/page?utm_source=email)或其他排序筛选参数生成的不同URL(English)。
  • URL结构差异:English页面可以通过带Englishwwwand withoutwwwThe domain access, or the URL ends with a slash/and without a slash, even withindex.htmlordefault.htmsuffixes.
  • Multi-site content distribution:If your content is published on multiple sites supported by AnQiCMS, or the content is authorized for redistribution on other websites.
  • Print version or mobile version:Page may have a dedicated version for different devices or reading methods.

These seemingly subtle URL differences may all point to different pages in the eyes of search engines. When search engines face multiple URLs with the same content, they will:

  • Which page is authoritative is confused:Don't know which index and version to prioritize display.
  • Disperse ranking signals:External links, social sharing, and other ranking signals may be spread across multiple duplicate URLs.
  • Waste of crawling budget:Search engines waste valuable resources crawling and processing duplicate pages, rather than discovering new content on the website.

Continuing this way, the website's search engine rankings may be negatively affected, and the exposure rate of important pages may also decrease.

Canonical URL: tells the search engine which is the 'home page'

The role of Canonical URL is like giving search engines a clear instruction, telling them which URL is the main page you want them to index and rank among multiple duplicate pages. This instruction is given through the HTML page's<head>Partly add one<link rel="canonical" href="首选URL" />Tagged to implement.When the search engine finds this tag, it will unify the weight and signal of all duplicate pages to this specified URL to avoid the aforementioned problem.

How to set Canonical URL in AnQiCMS

AnQiCMS integrates the Canonical URL feature into content publishing and template management, making it very intuitive.

  1. Specify the standard link when editing content in the background:When you scroll to the bottom of the page while adding a document or editing an existing document in the AnQiCMS backend, you will see a collapsible area named 'Other Parameters'.Expand this area, and you will find an input box named "Standard Link".

    Here, you need to fill in the "preferred" or "official" URL for the content. For example, if your articlehttps://www.yourdomain.com/news/detail/123There are multiple variants with parameters (such ashttps://www.yourdomain.com/news/detail/123?source=wechat), and you should fill in the "standard link" withhttps://www.yourdomain.com/news/detail/123.

    Key points:

    • The link you fill in must be a complete absolute path, that is, starting withhttp://orhttps://.
    • Only when you have an issue of content duplication, or you need to distribute the same content to other platforms (such as foreign trade websites), should you fill in a standard link that is different from the current page URL here.
  2. Correctly introduce the Canonical tag in the template:Although the standard link has been set in the background, you still need to add the corresponding Canonical tag in the website's HTML template to make it actually take effect.AnQiCMS's template system provides convenient tags to call this setting.

    You need to add the following code in the<head>Parts (usually)base.htmlor a similar public header template file):

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

    The meaning of this code is:

    • {%- tdk canonical with name="CanonicalUrl" %}This will attempt to retrieve the current page's Canonical URL setting and store its value in a namedcanonical.
    • {%- if canonical %}This is a conditional judgment, only when the "standard link" field on the backend is actually filled in, will the subsequent code be executed.
    • <link rel="canonical" href="{{canonical}}" />IfcanonicalVariables have values, and standard Canonical tags will be generated, amonghrefThe value of the attribute is the standard link set in the background.

    Through this way, AnQiCMS can dynamically generate the correct Canonical tag for each page, ensuring that search engines can always identify the authoritative version of the content.

Canonical URL使用**实践

  • Always use absolute paths:The specification link must be a complete URL, including the protocol (HTTP/HTTPS) and domain name.
  • Maintain consistency:Ensure that all pages of your website follow a unified protocol (HTTPS) and domain format (withwwwor withoutwww). For example, if your preference is tohttps://www.example.com,then all Canonical URLs should point to this form.
  • Self-referencing Canonical:Even if a page does not have duplicate content, it is recommended to set a Canonical URL pointing to itself.This helps the search engine understand the authority of the page faster, and prevent unintentional repetition that may occur in the future.AnQiCMS's template will handle this situation by default, and if 'standard link' is not manually set, and the page is unique, the system will usually output a standard link pointing to the current page.
  • Avoid conflicting signals:Do not confuse the Canonical URL with the 301 redirect.Canonical URL is “recommended”, 301 redirect is “mandatory redirect”.Avoid a page being Canonical to A, yet 301 redirected to B.
  • Monitor and inspect:Regularly use Google Search Console or other SEO tools to check the indexing status and crawler reports of the website, ensuring that the Canonical tags are correctly identified and applied.

Through the Canonical URL feature of AnQiCMS, you can easily and effectively manage website content, avoid duplicate issues, and thus optimize search engine crawling and ranking, enhancing the SEO performance of the website.This is a small but powerful feature, worth making full use of by every website operator.


Common Questions (FAQ)

  1. Q: What is the difference between Canonical URL and 301 redirect? A:Canonical URL (规范网址) is a "suggestion" or "hint" to search engines, indicating which URL among multiple similar content is the preferred version you want to be indexed and ranked, and users can still access all duplicate pages.301 redirect is a 'mandatory' instruction, which tells the browser and search engines that a page has permanently moved to a new address and will redirect users directly to the new address, the old page will no longer be accessed.When permanent migration is used, use 301. When there are multiple versions of the content but all are to be retained for access, use Canonical.

  2. Q: Should I set a Canonical URL for each page on the AnQiCMS website? A:In most cases, it is recommended to set a Canonical URL for each page on the website.Even if the page content is unique, self-referencing Canonical (that is, the page pointing to itself) also helps to clearly inform search engines of the authority of the page and prevent unexpected duplicate issues caused by URL parameter changes or other reasons.In AnQiCMS, you can manually specify it during content editing, or let the template automatically generate a Canonical tag pointing to the current page.

  3. Q: What impact will it have if I set the wrong Canonical URL? A:Setting an incorrect Canonical URL may have a negative impact on the SEO of the website.For example, if you point the Canonical URL of an important page to an unrelated page, or to a non-existent page, search engines may incorrectly index the page, resulting in your target page not receiving the appropriate ranking, and even potentially affecting the authority of the entire website.