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:
- Firstly, it will try to use
tdktag to get the current page'sCanonicalUrlAssign the value to a variable namedcanonical. - Then, a
{% if canonical %}Conditional judgment will checkcanonicalif the variable has a value. - Only when
canonicalA 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.