系列文章 – 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 浏览量: 6

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
Say goodbye to copy and paste: use AD INSERTER to realize a series of articles and automatically add multi-language CTA (record on the pit) https://www.shuijingwanwq.com/en/2026/06/07/16051/ https://www.shuijingwanwq.com/en/2026/06/07/16051/#respond Sun, 07 Jun 2026 08:40:21 +0000 https://www.shuijingwanwq.com/?p=16051 浏览量: 4

From manual copy to fully automatic, it took me half a day to step on three big pits and share it with you.

The pain point of the handicraft era

As a person who has written a technical blog for more than ten years, my ‘self-built VPN’ series has dozens of articles, both Chinese and English. At the end of each article, you must add a CTA to promote VPN generation services. The previous practice was:

  • After writing the article → open another old article → copy the CTA code → paste into a new article → save.
  • Repeat the English station again.
  • If the CTA copy is to be changed by one word, all articles are edited manually.

Not to mention I have other series (such as MySQL performance optimization, Linux operation and maintenance), and will also be equipped with different CTAs in the future.Manually copy and paste, it is definitely a nightmare.

So I started looking for automation solutions and finally locked the WordPress plugin ad inserter.

(Screenshot 1: Search plugin AD INSERTER)

(Screenshot 1: Search plugin AD INSERTER)

2. Why is AD INSERTER?

AD INSERTER is a very old ad/content insert plugin, and the free version is already powerful enough. It supports:

  • By article, page, home page, category, label,custom classification(such as the ‘series’ created by PublishPress Series) Insert content.
  • Support URL matching, device orientation, user roles, etc.
  • The insertion position can be precisely controlled (before/after text, between paragraphs, before and after comments, etc.).

My blog just used:

  • PublishPress Series To manage the article series (such as the ‘self-built VPN’ series).
  • polylang to realize bilingual in both Chinese and English.

AD INSERTER can theoretically match them perfectly. But in the actual configuration process, I stepped on three big pits, and I will talk about them one by one.

3. The first attempt: use the classification ID, completely invalid

Many tutorials on the Internet say that in ad INSERTER taxonomies Fill in the input boxCategory ID Just do it. So I first found the ID of the ‘self-built VPN’ series (see in the URL of the background editing series tag_id=35606) and then:

  1. Open AD INSERTER → block 1.
  2. In conditions found in the panel taxonomies input box.
  3. fill in 35606(tried also Series:35606).
  4. save.

Result: Visit any article (including totally irrelevant PHP tutorial) and the CTA appears at the bottom.All articles are available, including VPN series.
This means Series:35606 This writing method is not recognized by the plugin at all, the plugin treats it as an empty condition, so it is inserted into all the articles by default. This has nothing to do with the whitelist/blacklist, it is simply invalid.

This pit made me waste half an hour.

4. Key breakthrough: with alias + toggle taxonomy editor

I stare carefully taxonomies input box, find itThere is a small icon on the left. Mouse overhead Toggle Taxonomy Editor. I clicked it and a drop-down list popped up, which lists all my existing series (such as windows-to-ubuntu,self-hosted-vpn etc.).

(Screenshot 2: In the background, click the filter box on the left side of Taxonomies toggle Taxonomy Editor, and the drop-down list will pop up, which is essentially ajax request)

(Screenshot 2: In the background, click the filter box on the left side of Taxonomies toggle Taxonomy Editor, and the drop-down list will pop up, which is essentially ajax request)

(Screenshot 3: Search for "vpn" in the drop-down list, the search result is empty, I didn't understand the reason, I will give it up for the time being)

(Screenshot 3: Search for ‘vpn’ in the drop-down list, the search result is empty, I didn’t understand the reason, I will give it up for the time being)

I randomly chose a series (eg, windows-to-ubuntu), the text box automatically becomes Series:Windows-to-Ubuntu.
Suddenly realized: the correct format is series: alias(English colon), not a numeric ID.

So i’m taxonomies Manual input in Series:self-hosted-vpn.

But after saving, I found All articles(Except the VPN series) There are CTAs at the bottom, but the articles on the VPN series do not.
This is because taxonomies The small icon on the right side of the box is by default Black Fork ✖ – representative blacklist mode.
Blacklist means:Except for this series, all other series are displayed.
So I’m just telling the plugin ‘except self-hosted-vpn In this series, all other articles add CTA’ – the blacklist logic in the middle.

I click that icon, switch from ✖ to Black ticks ✔(whitelist mode).
Save and refresh the front desk again –Only the ‘self-built VPN’ series of articles appeared at the bottom of the article, other articles are clean.

Lesson:

  1. Use series: alias format, do not use numeric IDs.
  2. The small icon to the left of each condition box determines the whitelist/blacklist, be sure to confirm that it is black ✔.

5. Is the format messed up? Copying from the visual editor is a trap

CTA finally only appeared in the correct article, butThe typography is all messed up– No line breaks, the list disappears, and the title and body are crowded together.

(Screenshot 4 The effect of messing up the CTA format in the page)

(Screenshot 4 The effect of messing up the CTA format in the page)

How did I do it in the first place? I write CTA (visual mode) in the WordPress article editor, and thenCopy all, paste directly into the block 1 edit box of Ad INSERTER. It looks normal in the background preview of the ad inserter, but the front page becomes a piece of text.

Reason: Gutenberg block comments with WordPress copied content (<!-- wp:paragraph --> , etc.), although ad inserter can retain html tags, it does not parse Gutenberg blocks, and sometimes loses newlines.

Solution: switch tocode editormode.

Specific operation:

  1. In the WordPress article list, click the Edit link.
  2. In the code editor for editing the article, you will see the complete code like this (CTA content):

Html

&lt;!-- wp:paragraph -->
&lt;p>&lt;strong>拒绝折腾 | 专属 WireGuard VPN 代搭建服务&lt;/strong>&lt;/p>
&lt;!-- /wp:paragraph -->

&lt;!-- wp:paragraph -->
&lt;p>本频道长期实测各类网络优化方案。&lt;strong>自用线路已连续稳定运行超过 1 个月,全程无掉线记录&lt;/strong>。如果你不想反复踩坑、折腾复杂的服务器与协议配置,欢迎联系我获取专属解决方案。&lt;/p>
&lt;!-- /wp:paragraph -->

&lt;!-- wp:paragraph -->
&lt;p>&lt;strong>服务内容:&lt;/strong>&lt;br>✅ &lt;strong>远程代搭建&lt;/strong>:在你自己的服务器上部署专属 VPN,数据完全掌控,一劳永逸。&lt;br>✅ &lt;strong>免费试用福利&lt;/strong>:新用户可申请&lt;strong>免费试用一个月我的自建节点&lt;/strong>,亲自体验极致的稳定性与速度。&lt;br>✅ &lt;strong>效果保证&lt;/strong>:深度优化分流规则,彻底解决日常使用中的卡顿与连接超时问题。&lt;/p>
&lt;!-- /wp:paragraph -->

&lt;!-- wp:paragraph -->
&lt;p>&lt;strong>联系方式:&lt;/strong>&lt;br>Telegram:@shuijingwan&lt;br>微信:13980074657&lt;br>邮箱:&lt;a href="mailto:shuijingwanwq@gmail.com">shuijingwanwq@gmail.com&lt;/a>&lt;/p>
&lt;!-- /wp:paragraph -->
  1. Copy this code.
  2. Go back to the Block 1 editor for Ad INSERTER and click Toggle Tools on the editor toolbar – Toggle code generator button, switch tosource code pattern.
  3. Paste the code.
  4. save.
(Screenshot 5: In the background, use the code editor to copy the above code and save it in Block 1)

(Screenshot 5: In the background, use the code editor to copy the above code and save it in Block 1)


(Screenshot 6: The format is normal after saving, and the insertion is after content)

At this time, the foreground page is finally normal – line breaks, bold, list, and links are all displayed correctly.

Experience: always fromcode editorCopy content to Ad INSERTER, do not copy directly from the visual editor.

Six, insert position: after content vs after post

I use it by default Insertion Be after content, CTA appears at the end of the text of the article, before the comment area, and after the ‘Previous/Next’ navigation. I think it’s too close to the navigation, so I want to move down a little.

(Screenshot 7: After deleting the duplicate CTA content at the end of all articles under the Chinese self-built VPN series, the final effect is found, but I found that the content of Block 1 is somewhat close to the previous article and the next article)

(Screenshot 7: After deleting the duplicate CTA content at the end of all articles under the Chinese self-built VPN series, the final effect is found, but I found that the content of Block 1 is somewhat close to the previous article and the next article)

I try to change to after post——The effect is in line with expectations, and it is a little farther from navigation.

I have adjusted the insertion many times, and I want the CTA to be placed at the end of the content, and on the top of the previous article, I found that it is difficult to do it in the end. Decided to do so first. Accept the status quo. If you have obsessive-compulsive disorder, you can manually insert it into any position with short codes, but I think it is enough.

7. English series

My English ‘self-hosted vpn’ series alias is self-hosted-vpn-en, the series ID is 35608.

Create a new block (block 2):

  • taxonomies Enter Series:self-hosted-vpn-en.
  • The left icon switches to black ✔ (whitelist).
  • Insertion I chose this time after post(for comparison, but in the end you can also keep after content).
  • Copy the English version of the CTA code from the code editor:

Html

&lt;!-- wp:paragraph -->
&lt;p>&lt;strong>Stop the Hassle | Custom WireGuard VPN Setup Service&lt;/strong>&lt;/p>
&lt;!-- /wp:paragraph -->

&lt;!-- wp:paragraph -->
&lt;p>I have been testing various network optimization solutions for a long time. &lt;strong>My personal setup has been running continuously for over a month with absolutely zero downtime.&lt;/strong> If you are tired of troubleshooting and dealing with complex server configurations, feel free to reach out for a custom solution.&lt;/p>
&lt;!-- /wp:paragraph -->

&lt;!-- wp:paragraph -->
&lt;p>&lt;strong>What I Offer:&lt;/strong>&lt;br>✅ &lt;strong>Remote Setup Service:&lt;/strong> I will deploy an exclusive VPN on your own server. You keep full control of your data—set it once and forget about it.&lt;br>✅ &lt;strong>Free Trial:&lt;/strong> New users can apply for a &lt;strong>one-month free trial of my self-hosted node&lt;/strong>, so you can personally experience the speed and stability.&lt;br>✅ &lt;strong>Performance Guaranteed:&lt;/strong> Deeply optimized routing rules to completely eliminate lag and connection timeouts in daily use.&lt;/p>
&lt;!-- /wp:paragraph -->

&lt;!-- wp:paragraph -->
&lt;p>&lt;strong>Contact Me:&lt;/strong>&lt;br>Telegram: @shuijingwan&lt;br>WeChat: 13980074657&lt;br>Email: &lt;a href="mailto:shuijingwanwq@gmail.com">shuijingwanwq@gmail.com&lt;/a>&lt;/p>
&lt;!-- /wp:paragraph -->
(Screenshot 8: Paste the above code in Block 2, insert is after post, enter series:self-hosted-vpn-en, and block 1 is also adjusted to after post)

(Screenshot 8: Paste the above code in Block 2, insert is after post, enter series:self-hosted-vpn-en, and block 1 is also adjusted to after post)

Save, the English CTA at the bottom of the English article at the front desk is displayed normally. Perfect!

(Screenshot 9: The final effect of the articles in the English series, in line with expectations)

(Screenshot 9: The final effect of the articles in the English series, in line with expectations)

8. Clean up the old code added manually

The last step: Go to every article in the ‘Self-built VPN’ series (Chinese and English), and delete the CTA code that was manually pasted before. Otherwise, the page will appear two CTAs (one manual and one automatic).

Batch processing can be used better search replace Plugin, replace all old code at once. I changed it manually, because there are not many articles.

9. Summary and suggestion

If you are also a WordPress blogger and have similar needs:

  • Automatically add different contents under different series/categories/labels
  • Support Chinese and English multi-language
  • I don’t want to manually copy and paste every time

AD INSERTER + PublishPress Series + Polylang is a verified combination.

A few core points to share with you:

  1. use aliases, don’t use id:taxonomies Input series: alias(English colon).
  2. Whitelist/Blacklist: Note the small icon on the left side of the text box, black ✔ is a whitelist, black ✖ is a blacklist.
  3. Format: from WordPress code editorCopy the content and paste it into the source code mode of Ad INSERTER (Toggle code generator), do not copy directly from the visual editor.
  4. insertion position:after POST is usually the most suitable.
  5. Test: Enable a block first, confirm that it is correct and then configure other.

Now, I can write technical articles with peace of mind, and the CTA will automatically appear where it should appear. In the next step, I plan to add a different CTA to the ‘MySQL Performance Optimization’ series, and guide readers to contact me for database tuning services.

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