Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 13 replies, has 0 voices.

Last updated by Bruno Kos 23 hours, 59 minutes ago.

Assisted by: Bruno Kos.

Author Posts
October 30, 2025 at 9:49 pm #17534459

cedricV-14

Background of the issue:
I am trying to use the Advanced Translation Editor (ATE) and Automatic Translation for our site, which has over 18,000 posts. Our site uses several Custom Post Types (CPTs) with a custom permalink structure: CPT-slug/%category%/post-name/. This structure is enabled using the post_type_link filter, which replaces %category% with the term slug.

Symptoms:
When we send a post to Automatic Translation (ATE), the ATE engine fails to parse the internal links in the post_content due to our /%category%/ permalink structure.

It destroys the links in two ways:
Links are Deleted: Most <a> tags are stripped and replaced with <g id="..."> tags, completely destroying the link and its href attribute.
Links are Mangled: The few links that ATE tries to translate are broken. It fails to parse the full CPT link and defaults to only the translated category slug (e.g., .../logiciel/).
This is not a configuration error. This is a parsing failure in the ATE engine.
Here is the HTML from a post before and after AI translation.

Original (Dutch):
<code><p>
...Zo lanceerde hidden link">Perplexity pas de AI-browser Comet en introduceerde OpenAI Atlas. Ook Microsoft ... hidden link">zowel Edge als Copilot forceren op gebruikers.
...
<p>De browser is hidden link">op Chromium gebaseerd...</p></code>
AI Translated (French):
<code><p>
...Ainsi, <g id="gid_0">Perplexity a récemment lancé le navigateur IA Comet</g> et <g id="gid_1">OpenAI a introduit Atlas</g>. Microsoft ... <g id="gid_2">forcer à la fois Edge et Copilot sur les utilisateurs</g>.
...
<p>Le navigateur est hidden link">basé sur Chromium...</p></code>
As you can see:
3 of the 4 links have been destroyed and replaced with <g> tags.
The 1 remaining link has been mangled from a full post URL to only a category archive URL.

Why Standard Solutions FAIL:
"Translate Link Targets" does not work. This tool cannot repair links that the ATE has already deleted (the <g> tags). It has nothing to scan or fix.

Duplicating Content & Repairing: This also fails, because as soon as we send the duplicated post back to the ATE for text translation, the ATE re-destroys the links.

Questions:
How can we prevent ATE from destroying internal links during translation?
Is there a way to make ATE compatible with CPTs using a /%category%/ tag in their permalink structure?

October 31, 2025 at 11:53 am #17535722

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

To investigate this further, I’ve prepared a sandbox site where we can safely reproduce the issue with ATE and your custom permalink structure.

Sandbox URL:
hidden link

On this sandbox:

* ACF is installed and ready — you can create your Custom Post Type(s) and taxonomy exactly as on your site.
* Automatic Translation (ATE) is active and configured.
* A file manager plugin is also available in case you need to add custom code

Please try to reproduce the behavior here by:

1. Creating the same CPT and permalink structure (CPT-slug/%category%/post-name/).
2. Adding a few posts with internal links between them.
3. Sending one of them for automatic translation via ATE.

Once reproduced, we’ll be able to capture the environment and escalate this case to our developers for deeper investigation.

October 31, 2025 at 2:03 pm #17536027

cedricV-14

Hi Bruno,

I've setup the same posttypes & taxonomies and created some newsposts and a blogpost.
I've set the settings the same way as on the itdaily website.

The problem already shows partly (the links misbehave).

but i tried to set the Language url format to 'A different domain per language' as its set at the itdaily.be website (itdaily.fr, itdaily.com). Put in some fake urls to get the exact same issue as our site.

but now the wpml key has been disconnected. I can't translate using PTC anymore.
Could you add the site key again?
Is there a way to connect 3 different sandbox urls?

Thanks

October 31, 2025 at 2:18 pm #17536128

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Thanks a lot for setting that up and for confirming the issue already shows partially.

I’ve added a new site key and re-registered Automatic Translation on the sandbox, so you should now be able to use ATE again. I’m not entirely sure why the connection changed after switching the language URL format, but it’s all set up again.

Just to note — in my opinion, the “Different domain per language” option shouldn’t really affect how ATE parses internal links. The issue should also appear when using the language in directories format.

To help us confirm exactly what’s happening on the sandbox:

* Could you please show me (screenshots will help) where the links are breaking — both in the backend (the post content in the editor) and on the frontend (the rendered output)?
* If possible, please also mention which post(s) you sent for translation and which links got affected, so I can check them directly.

November 2, 2025 at 10:03 pm #17539205

cedricV-14

Hi Bruno,

Thanks for the update.

I reproduced the issue on the sandbox. I created a few short news articles; the latest example is:
hidden link

In that article, the phrase “Chat control” links internally to another news post. I then translated the article to English using the Advanced Translation Editor (screenshots 1 and 2). During automatic translation with PTC, the second URL field also remains empty; that’s another side note/bug. After saving the translation and opening the translated post (screenshot 3), the internal link no longer points to the translated target post but instead becomes a category URL.

I can’t show this on the frontend because the second domain doesn’t exist on the sandbox, but the incorrect link is clearly visible in the editor. From testing on the sandbox, this seems to happen only when WPML is set to use different domains per language. (it worked when it set to the default /en/)

wpml_3.png
wpml_2.png
wpml_1.png
November 3, 2025 at 11:53 am #17540927

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

I’ve set the sandbox to use different domains per language now. You can reproduce and show me the issue directly there (screenshot/url of the frontend).

The secondary domain will be something like:
hidden link

You’ll just need to bypass the browser warning about the non-secure (self-signed) certificate — once you accept that, it should work fine.

domain per language.jpg
November 3, 2025 at 2:52 pm #17541873

cedricV-14

Hi Bruno,

I've translated this post to french with PTC (screenshot wpml-4):
NL
hidden link

FR
hidden link

Now you can see the 'Chat Control' internal link in dutch:
hidden link

has changed to this in french:
hidden link (screenshot wpml-5)

The article of Lenovo does exist in french, so it should link to that page.

To make it more clear i've added 4 seperate internal links to an article. They are all translated and all link in french go to the category page.
NL
hidden link
FR
hidden link

wpml-8.png
wpml-7.png
wpml-6.png
wpml-5.png
wpml-4.png
November 4, 2025 at 7:49 am #17544153

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Thank you for the testing and clarifications! I’m checking this with our second-tier team and will keep you updated.

November 4, 2025 at 10:40 am #17544891

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

This has been escalated to our 2nd tier team team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

November 4, 2025 at 1:08 pm #17545769

cedricV-14

Thanks for the update! I’ll keep an eye on my email for any updates or further questions from your side.

November 4, 2025 at 2:32 pm #17546279

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

The issue with internal links not translating correctly happens because the post type was using WordPress’s default “category” taxonomy instead of a dedicated taxonomy. WPML handles custom taxonomies differently, so using a proper one ensures links translate automatically.

Here’s what to do:

1. Create a dedicated taxonomy

* Go to ACF → Taxonomies (or use your CPT UI plugin).
* Create a new taxonomy — for example:

* Plural label: Product Categories
* Singular label: Product Category
* Taxonomy key: product_category
* Under Post Types, assign it to both your custom post types:

* nieuws
* product

2. Set the correct rewrite rules

* Go to Settings → Permalinks.
* Make sure the structure for your post types looks like this:

* news: hidden link
* product: hidden link
* Set:

* has_archive → false
* with_front → true
* Save changes.

3. Create posts under the translated categories

* Add a post to your custom post type (nieuws or product) and assign it to the appropriate translated taxonomy term.
* When you translate this post via WPML, do not manually edit the link in the translated version — WPML will automatically adjust the internal URL to point to the translated version.

4. Test internal links again

* Check if the links now correctly switch between languages (for example, /fr/nouvelles/... ↔ /nl/nieuws/...).

If you must use the built-in taxonomy “category,” then WPML can’t automatically adjust these internal links. In that case:

* You’ll need to manually translate the URLs, or
* Blacklist the requests so WPML doesn’t try to rewrite them automatically.
Instructions for blacklisting are available here:
https://wpml.org/documentation/getting-started-guide/sticky-links/#linking-to-pages-in-a-different-language

Can you check the above and let me know if this helps? I am attaching images that follow this process.

image.png
image1.png
image2.png
image3.png
November 5, 2025 at 8:39 am #17548655

cedricV-14

Hi Bruno,

Thanks for the updates, this indeed solves the issue.
Still seems to me like a bug that the default category can't be used for these urls in translations but this is a good quick fix.

1) Is there a quick way to fix all the previous translated internal links in the 18k articles? (without draining our credits). Will the 'Update internal links' option in wpml solve this, now the links are translated to the categorylink?

I'm going to start implementing the custom taxonomy on the live site.

2) What could be the cause that the slug doesn't translate and we have to do this manually? It should be the same as the translated but each translation this stays empty. (screenshot)

wpml-9.png
November 5, 2025 at 8:40 am #17548672

cedricV-14

2) translated title*

November 5, 2025 at 10:10 am #17549135

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

You can try Scan now and adjust links, but perhaps it may not work as it would not not cover all the scenarios (let us know if this fails so we can check if there is perhaps a database workaround possible).

As for that second option, it would not be there automatically (the translation of the slug) and it only shows up in the translation editor when you choose "Translate (this will include the slug in the translation and not create it automatically from the title)" option in WPML -> Settings. Was your initial plan to translate these slugs, or?

translate.jpg