In the operation of a website, the management of external links is an indispensable part of content strategy and search engine optimization (SEO). Particularly likerel="nofollow"Such an attribute, it tells the search engine not to pass link weight to the linked page, which is crucial for managing the link health of the website and avoiding potential SEO risks. AnQiCMS (AnQiCMS) provides various ways to handle and display external links in content, including automatic additionrel="nofollow"Properties, allowing website administrators to flexibly control the behavior of these links.
Background content settings: globally control external link properties.
AnQi CMS provides a global option in the background content settings to manage external links in the content. This setting is located inBackend settings-u003eContent settingsAn area where a key option isDo you want to automatically filter external links.
This option has a direct impact on external links contained in the content:
- Select “Auto-filter external links”If we check and enable this option, the system will automatically detect and remove all external links from the content at the time of publishing.This means that any links pointing to external domains will not be retained in the final published content.This is usually applicable to those who wish to strictly control the purity of content or avoid any loss of link weight on websites.
- Select “Do not filter external links”If we do not check or disable this option, the system will retain all external links in the content. But more importantly, Anqi CMS will intelligently manage these retained external linksAutomatically added
rel="nofollow"property.This mechanism is very practical, it allows us to show external resources to users while also indicating to search engines that we do not endorse the quality of these external links, thus avoiding passing on our own link weight.
Through this global setting, we can uniformly handle external links in the content based on the overall operation strategy of the website, whether to completely remove or retain and addnofollowProperty.
Template filter: Dynamically process links in content
In addition to the global settings in the background, Anqi CMS also provides fine-grained control at the template level, especially byurlizeandurlizetruncA filter to process unformatted URLs in text.
Sometimes, our article content may contain URLs or email addresses in plain text, such aswww.example.comor[email protected]And these contents we hope can be automatically converted into clickable hyperlinks. At this time, you can use the template to do so.urlizeorurlizetruncfilter.
urlizeFilterThis filter can recognize URLs and email addresses in text and automatically convert them into clickable links with<a>. It is worth noting that Anqi CMS willAutomatically for these byurlizeAdd the generated link plusrel="nofollow"propertyThis is a very convenient feature for websites that need to display a large amount of third-party information sources but do not want to pass SEO weight to these sources.urlizetruncFilter: Function andurlizeSimilar, but it allows us to specify the display length of the link text. When the original URL is too long,urlizetruncit will truncate it and display...ending, while retaining the complete link function. Similarly, these will alsourlizetrunclinks generated willautomatically haverel="nofollow"property.
These filters are particularly important when processing user submitted content, comments, or any other dynamic text that may contain unformatted URLs, as they ensure link availability while also considering SEO practices.
Code example (nofollow will be automatically recognized and added in the content):
Assuming your content variablearticleContentContains plain text URL, you can use it in the template like this:
{# 假设 articleContent 包含纯文本 URL,如 "访问我们的网站 www.anqicms.com 获取更多信息。" #}
<p>{{ articleContent|urlize|safe }}</p>
After processing, the output HTML to the page might be something like:
<p>访问我们的网站 <a href="http://www.anqicms.com" rel="nofollow">www.anqicms.com</a> 获取更多信息。</p>
(Please note|safeThe filter is to ensure that HTML tags can be parsed correctly rather than being escaped.)
Additional control of the友情链接
For the specific type of external link such as "friendship link", AnQi CMS also provides a more intuitive control method. In the friendship link management function, each friendship link can be individually set to add or notrel="nofollow"Property.
When we uselinkListWhen calling the friend link in the template, you can decide whether to render according to each link'sNofollowattribute.rel="nofollow"This means we can add友情links without weight for those who trust each other and want to pass on the weightnofollowand for those who do not need to pass on the weight or have not fully trusted yet, we add the linksnofollowRealized a more flexible strategy.
Code example (friend links can be added with nofollow as needed):
{% linkList friendLinks %}
{% if friendLinks %}
<div>
<span>友情链接:</span>
{% for item in friendLinks %}
<a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank">{{item.Title}}</a>
{% endfor %}
</div>
{% endif %}
{% endlinkList %}
In this example, only when the background has explicitly checked a friend linkNofollowOption (i.e.,item.NofollowWith1then the link will be displayedrel="nofollow".
Whyrel="nofollow"So important?
rel="nofollow"The attribute plays a key role in the operation of the website, mainly solving the following problems:
- Manage link weightTell the search engine not to pass the 'link weight' (or 'link asset') of the current page to the target page.This helps us control the SEO effect of the website more accurately, avoiding passing valuable weight to irrelevant or low-quality external sites.
- Adhere to search engine guidelinesFor content that is not trusted, paid links, user-generated content (UGC) or sponsored content, search engines usually recommend using
nofollow(or more specificugc/sponsoredThis attribute helps avoid being penalized by search engines due to improper links. - Prevent spam comments and contentIn the comment section or forum and other user-generated content areas, use
nofollowCan effectively reduce the motivation of spam information publishers to post low-quality content to obtain links. - Enhance the credibility of content: When referencing external materials, if you cannot fully guarantee the long-term validity or credibility of their content, use
nofollowis a responsible practice, providing information reference while avoiding potential liabilities.
In summary, Anqi CMS provides a comprehensive and flexible external link management solution through global content settings in the background, intelligent filters in the templates, and independent control for friend links, ensuring that the website can maintain good SEO health and content control while providing rich content.
Frequently Asked Questions (FAQ)
1. The setting of 'Whether to automatically filter external links' and the priority of the filter in the templateurlizeWhich one is higher?
The setting of whether to automatically filter external links in the background is global and has the highest priority. If this option is set to 'Automatically filter external links', then all external links in the content (including those generated byurlizeThe links generated by the filter will be removed,urlizeThe filter will also be unable to create clickable external links. Only when you select "Do not filter external links,"urlizeThe filter will become effective and will automatically add to the external links it identifies and convertsrel="nofollow"Property.
2. Can I add attributes to external links exceptrel="nofollow"other than thatrelCan I? For exampleugcorsponsored.
The core feature of AnQi CMS automatically adds external links by defaultrel="nofollow"Currently, the systemdoes not provide directlyIt can be added automatically in the background or through simple configurationugcorsponsoredetc., more detailed settingsrelProperty.If you need to use these properties, you may need to customize them at the template level or manually add them through the HTML source code mode during content editing.nofollowControl, if you need otherrelProperties, the same needs further processing at the template level.
3. Why are my external links not added automaticallyrel="nofollow"?
This usually has several reasons:
- The background "Content Settings" is not enabled "Do not filter external linksPlease check:Backend settings-u003eContent settingsIn,“Is the 'Auto-filter external links' option checked? If the 'Auto-filter external links' option is selected, the link will be removed directly instead of added.”
nofollow. To add.nofollowYou need to make sure it is not checked (i.e., select 'Do not filter external links'). - The link is not a plain text URL, it has not been processed by
urlizeFiltering processIf the link is manually added through the content editor (rich text editor) and the option 'Do not filter external links' is selected in the background settings, AnQi CMS will automatically recognize and add itnofollowIf your link is in another form, such as through custom fields or certain plugins, you may need to ensure that they are correctly identified or processedurlizeby filters. - Set friend links separately: Each friend link has an independent
Nofollowcheckbox. If a friend link is notnofollow, please check the edit page of the link and confirmNofollowWhether the option has been checked.