免费版 – Eternal Night https://www.shuijingwanwq.com There is no problem not worth solving, and no technology not worth learning! Sun, 07 Jun 2026 12:19:15 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 Accurate CTA insertion of multi-language, multi-series articles using AD Inserter https://www.shuijingwanwq.com/en/2026/06/07/16079/ https://www.shuijingwanwq.com/en/2026/06/07/16079/#respond Sun, 07 Jun 2026 12:15:25 +0000 https://www.shuijingwanwq.com/?p=16079 浏览量: 5

When running a technical blog in both Chinese and English, I came across a need that is not too complicated but a little cumbersome:

  • At the end of the ordinary article (non-VPN series), according to the language of the article, display them separatelyChinese VersionOrEnglish versiongeneric contact CTA.
  • In VPN series (including Chinese and English), the generic CTA is not displayed, but the exclusive ‘Wireguard VPN generation service’ advertisement (Block 1 and Block 2) is displayed.
  • Other series or languages may be added in the future, and I hope the configuration can be as clear and easy to expand.

After some tossing, I finally passed AD Inserter Free Edition The blacklist function, combined with the language code of Polylang, perfectly meets the needs. The following are the complete configuration ideas and steps for the reference of friends with similar needs.

The overall logic

My articles are divided into two categories by series:

  • VPN series: Chinese and English two series, respectively use custom classification method Series: self-hosted-vpn(Chinese) and Series: self-hosted-vpn-en(English). These articles need to display the exclusive VPN generation CTA (Block 1 and Block 2).
  • general article: Does not belong to the above series. These articles need to display the corresponding generic CTA according to the current language.

In order to realize ‘general articles display general CTA, VPN articles do not display general CTA’, the most direct way is to use the general CTA block,All articles on the blacklist exclude VPN series.
Also, since there are two languages, I need two generic CTA blocks:

  • block 3: Chinese general CTA (only displayed in ordinary Chinese articles)
  • block 4: English universal CTA (only displayed in ordinary English articles)

2. Key points: how to distinguish language?

My blog uses polylang Plugins manage multiple languages. Polylang will add a language-related class to each article page, and can wpml-current-language This parameter to identify the current language (compatible with WPML writing).
In the ‘Black and White List’ of Ad INSERTER, we can use this parameter directly:

  • Chinese page:wpml-current-language: en
  • English page:wpml-current-language: en

The specific configuration steps after streamlining

Principle:wpml-current-language: en Has been excludedAll English articles(including English VPN series), so no need to exclude separately Series: self-hosted-vpn-en. the same,wpml-current-language: en All Chinese articles are excluded, so there is no need to rule out Series: self-hosted-vpn. The blacklist of the two generic blocks only needs two conditions, which are concise and no redundant.

1. Prepare two generic CTA blocks

Block 3 – Chinese General CTA

Block 3 – Chinese General CTA Settings
Block 3 – Chinese General CTA Settings


core setting:

  • Insert position:after post
  • Blacklist:
  • wpml-current-language: en → Exclude all English articles
  • Series: self-hosted-vpn → Exclude Chinese VPN series

In this way, Block 3 will only beThe language is Chinese and does not belong to the Chinese VPN seriesdisplayed in the article.

Block 4 – General CTA in English

Block 4 – English general CTA settings
Block 4 – English general CTA settings


core setting:

  • Insert position:after post
  • Blacklist:
  • wpml-current-language: en → Exclude all Chinese articles
  • Series: self-hosted-vpn-en → Exclude English VPN series

In the same way, block 4 will only be inThe language is English and does not belong to the English VPN seriesdisplayed in the article.

2. VPN series exclusive blocks (Block 1 and block 2) remain the same

  • block 1: whitelist Series: self-hosted-vpn, insert position after post.
  • block 2: whitelist Series: self-hosted-vpn-en, insert position after post.

These two blocks are not set to blacklist, so they will be displayed as long as the series conditions are met. And since these series have been excluded from the blacklist, there will be no duplicate inserts.

The effect verification

After the configuration is complete, let’s look at the actual page effect.

1. VPN series of articles (exclusive CTA should be displayed, general CTA is not displayed)

  • Chinese VPN article:
    It can be seen that there is ‘Reject tossing | Exclusive WireGuard VPN generation service’ at the end of the article, and there is no general contact information.
  • English VPN articles:
    Display the English version of the exclusive CTA (‘Stop the Hassle | Custom Wireguard VPN Setup Service’), and the generic CTA has not appeared.
Chinese VPN article:

It can be seen that there is "Reject tossing | Exclusive WireGuard VPN generation service" at the end of the article, and there is no general contact information.
Chinese VPN Article Effects
English VPN article effect
English VPN article effect

2. General articles (should display the generic CTA of the corresponding language)

  • General Chinese articles:
    The Chinese general contact information (including service list, WeChat, mailbox, etc.) is displayed correctly at the end.
  • General English articles:
    The English general contact information is displayed correctly at the end.
The effect of ordinary Chinese articles
General English article effect

5. Scalability and maintenance tips

The design principles of this program are:The blacklist is only used for general CTA blocks, and the exclusive series only needs to use whitelists in its own block.

  • When adding exclusive series:
    Create a new exclusive block and set the whitelist to the series (e.g. Series: docker-tutorial), the insertion position is the same as the general block.
    At the same time, the series needs to be added to the blacklist of each general CTA block (Block 3, Block 4, and other language general blocks that will be added in the future).
  • If the new series belongs to the Chinese language, just add it to the blacklist of the Chinese general block (block 3);
  • If both Chinese and English languages are available, both general blocks must be added.
    This operation simply appends a series name to the blacklist text box of the generic block (for example , series: docker-tutorial), which can be completed in a few seconds.
  • when adding a language:
    Create a new generic block corresponding to the language, and all other languages need to be excluded from the blacklist (such as wpml-current-language: en, en) and all exclusive series.
    At the same time, all existing generic blocks also need to add new language conditions to the blacklist (such as adding to the blacklist of block 3 wpml-current-language: ja).

Although it is impossible to do ‘one configuration at one time, never’, but all maintenance work is done in a text box of the black and white list, with clear logic and low cost.

6. Summary

With the Blacklist function of the free version of the AD INSERTER, combined with the language parameters of Polylang, we can easily achieve:
✅ Different languages display different CTAs
✅ Specific series of articles are automatically replaced with exclusive CTAs
✅ Avoid the redundancy problem of multiple blocks simultaneously inserted at the same time
✅ Concise configuration

If you are also running a multilingual WordPress site, and you need to refine the ad or service information at the end of each article, I hope this record will be useful to you.

Attachment: The AD INSERTER version used in this article is the latest free version (2.7.x), and the Polylang version 3.5+. The syntax of the black and white list is Classification method: value, multiple conditions are separated by commas.


If you have any questions or a better plan, please leave a message to discuss.

]]>
https://www.shuijingwanwq.com/en/2026/06/07/16079/feed/ 0