How to automatically filter or process external links in AnQiCMS article content?

Calendar 👁️ 56

In daily website content operations, we often encounter situations where external links need to be referenced in articles.These external links are handled well, they can enrich the content and provide references, but if not managed properly, they may also affect the website's SEO performance or user experience.AnQiCMS as a content management system that focuses on efficiency and SEO has provided practical automation solutions in this regard, helping us better manage external links in article content.

Core options in the background content settings

The core mechanism of AnQiCMS handling external links in articles, mainly reflected in the "Content Settings" backend. There is a very crucial option - "Do you want to automatically filter external linksThis option provides content publishers with two entirely different strategies for handling external links in the content of articles.

When you choose “Automatically filter external linksWhen you publish or update article content, the system will automatically detect and remove all links pointing to external websites.This practice is very useful for those who want to keep the content of their website highly 'pure', not passing any link weight to the outside, or strictly limiting external jumps for security reasons.For example, some government or financial official websites may need to ensure that all links are within their own domain names to avoid users being redirected to uncontrollable third-party pages.

If your operational strategy allows for the inclusion of external links but you still want to maintain some control over SEO, then you can choose to use the termDo not filter external links.In this case, AnQiCMS will not remove the external links in the article, but will automatically add them to the external linksrel="nofollow"Property.nofollowThe tag is used to tell the search engine that the current page does not want to pass 'link voting' or 'weight' to the external page being linked.This ensures the integrity and reference value of the article content, making it convenient for users to click and view, while also avoiding the dispersal of the site's SEO weight due to a large number of external links, which is a very balanced and commonly used processing method.

This setting's flexibility lies in the fact that it provides a global automation mechanism.You do not need to manually check and modify each external link every time you edit an article, AnQiCMS will automatically complete these tasks according to your preferences, greatly improving the efficiency of content publication.

Link handling at the template level:urlizeFilter

In addition to the global settings on the back end, AnQiCMS also provides intelligent link processing capabilities at the template rendering level, which is mainly achieved throughurlizeTo implement a filter.

Imagine that you might have directly pasted a URL address into the article content, such ashttps://en.anqicms.com, but this address was not enclosed in<a>In the tag, it cannot be clicked directly. In this case, use it in the template.urlizeThe filter can automatically identify URL strings in text (including email addresses) and convert them into clickable HTML links. More importantly, this filter will alsoAutomatically add these links torel="nofollow"property.

For example, in your article detail template, if you need to display the article content and want to automatically format any unformatted URLs tonofollowThe link, you can use it like this:

<div>
    {{ archiveContent|urlize|safe }}
</div>

Here|safeIt is a safe filter in the Django template engine, which tells the system that this content is safe and does not need to be escaped as HTML entities so that the browser can correctly parse the generated content<a>.urlizeThe existence of the filter provides a good supplementary processing for those scenarios where link tags may not be manually added during content editing, ensuring consistency in user experience and SEO strategy.

A powerful tool for batch processing existing content

Sometimes, we may need to unify adjust the links in a large number of published articles on the website. AnQiCMS's “Full site content replacementThe feature (under 'Content Management') can be used.Although it is not specifically designed for automatic filtering of external links, as a powerful content processing tool, it can achieve one-click replacement of keywords or links throughout the entire site.

For example, if your website has ever linked to an expired or rebranded external resource, you can use this feature to batch replace all text or URLs pointing to the old link with the new address, or even replace them with empty, thus achieving batch maintenance and cleanup of internal and external links on the site.This is undoubtedly a tool that saves time and labor costs for websites with a large amount of content.

In general, AnQiCMS provides flexible external link filtering through the 'Content Settings' in the background.nofollowThis strategy is implemented through the template level.urlizeThe filter has enhanced link recognition and processing capabilities, and is supported by the 'site-wide content replacement' function for batch maintenance.These automated and batch solutions ensure that the website maintains content richness while also effectively managing the SEO impact and content security of external links.


Frequently Asked Questions (FAQ)

Q1: If I change the external link filtering option in the content settings (for example, from 'Unfiltered' to 'Filtered'), will it affect my existing articles?

A1: When you modify the setting of 'whether to automatically filter external links', this new rule usually takes effect when you edit and save the article content next time.That is to say, if you only modify the settings without saving the existing articles, then the external links of these articles will remain in their original state.If you want the new settings to be applied immediately to all articles, you may need to combine the 'Site-wide Content Replacement' feature for batch processing, or edit and save each article one by one.

Q2: AnQiCMS will automatically add external images, videos, and other resource links to the content of my articlesnofollowor filter them for me?

A2: “Whether to automatically filter external links” this setting mainly targets HTML links in the article content (<a>tags). For external images (<img>tags) or videos (<iframe>/<video>Links to resources such as these, AnQiCMS has a separate option for 'whether to download remote images', you can choose to download remote images to the local server to improve loading speed and stability, but it will not directly add these resource linksnofollowProperty.

Q3: Can I manually set not to add for specific external links?nofollowOr can I have more refined control?

A3: The 'Automatically filter external links' in AnQiCMS is an automated strategy that is global or regional (depending on the content model or category settings). If 'Do not filter external links' is selected, the system will add external links to all external links uniformly.rel="nofollow". The document does not mention the option to manually override this property directly in the background for a single external link. If you have a very special single link that needs to be removednofollowYou may need to manually modify the code in the HTML mode of the article content editor, but this will override the system's automated processing, and you must ensure that your modifications to the HTML code are safe.

Related articles

How to truncate a string and add an ellipsis (...) in AnQiCMS templates?

In website content management, we often need to present a long text (such as an article abstract, product description) in a concise way on the page, which can not only save space but also improve the user's browsing efficiency.If the long text is not processed and displayed directly in the list, it may lead to a disorganized page and affect the user experience.The template engine of AnQiCMS (AnQiCMS) provides flexible and powerful filter (Filters) functionality, which can help us easily implement string truncation and automatically add ellipses.### AnQiCMS

2025-11-07

How to display a message form on the AnQiCMS website and support the display of custom fields?

Today, with the increasing importance of digital operation, the website message board is not only an important bridge for user interaction with the website, but also a key channel for collecting user feedback and understanding market demand.AnQiCMS (AnQiCMS) fully understands this need, providing flexible and powerful form display and custom field support, allowing you to easily create an interactive platform that meets business requirements. ### Step 1: Configure the custom fields of the comment form To give the comment form more personalized information collection capabilities, we need to configure it first in the Anqi CMS backend.

2025-11-07

How to control specific content to be visible only to the VIP user group in AnQiCMS?

In content operation, it is a common strategy to present some high-quality content exclusively to VIP users.This can not only enhance user stickiness and promote user conversion, but it is also an important way to realize content monetization.AnQiCMS provides a complete user group management and content permission control function, allowing you to easily implement the need for specific content to be visible only to VIP user groups. ### Backend Settings: Distinguishing Users and Content To make VIP exclusive content visible, you first need to make two key configurations in the AnQiCMS backend: user group management and content permission settings.

2025-11-07

How to display the contact information of the website, such as phone, address, email, in AnQiCMS templates?

The contact information of the website, like a business card, is an important channel for visitors to understand and trust the website.Whether it is to hope that customers call to consult or to make it convenient for them to communicate through email, or to guide them to the physical store, clear and accurate contact information is indispensable.In AnQiCMS, displaying this information is a very intuitive and flexible thing, which allows us to not only manage uniformly but also display at different positions on the website according to our needs.

2025-11-07

How to automatically wrap long text for display in AnQiCMS templates?

During the operation of the AnQiCMS website, we often encounter scenarios where we need to display a large amount of text content, such as the main content of article detail pages, detailed descriptions of product introductions, or long introductions on category pages.These long texts, if not handled properly, may cause page layout to be disordered and affect the user's reading experience.Fortunately, AnQiCMS's powerful template engine provides various flexible ways to manage and display these long texts, including automatic line breaks and content truncation.AnQiCMS's template system has adopted the syntax of Django template engine, allowing us to use double curly braces

2025-11-07

How does AnQiCMS control the special display style of articles by setting the Flag attribute?

In Anqi CMS, the Flag attribute of the article is a very practical feature, which allows us to tag articles with special "labels" to display them uniquely on the website front-end.This mechanism greatly enhances the flexibility and diversity of content display, allowing website operators to easily control the display style and position of articles based on the importance, characteristics, or promotion needs of the content.What is the article Flag attribute? In simple terms, the Flag attribute is like a special "mark" that is attached to the article, it is not a category of the article

2025-11-07

How to judge if a variable is empty in the template and display a default value?

During the presentation of web content, we often encounter such situations: a variable may be empty due to data loss, user failure to fill in, or other reasons.If you directly output these empty variables in the template, it may result in blank spaces on the page, affecting the appearance, or even cause layout errors, and may even expose unnecessary debugging information.It is particularly important to set a suitable default value for these variables that may be empty to ensure the completeness of website content display and the smoothness of user experience.The AnqiCMS uses a template engine syntax similar to Django

2025-11-07

How to implement custom template file calling for category or article detail pages in AnQiCMS?

During the process of building a website with AnQiCMS, we often encounter such needs: we hope that a certain category list page or a unique article detail page has a layout and style that is different from the global unified default template.AnQiCMS is a content management system focused on flexibility and customization, providing a very convenient and powerful solution in this regard, allowing us to easily implement this fine-grained template calling.Implement custom template calling for category or article detail pages, AnQiCMS mainly provides two main methods

2025-11-07