Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are experiencing 404 errors on all links in translations using the WYSIWYG Classic editor or Gutenberg. This issue does not appear on your staging website.
Solution:
Ensure that the option 'Translate Link Targets' under WPML > Settings is enabled, as this resolved the issue on our test site. If this does not resolve your issue, check if the custom post type (CPT) archive and the taxonomy base are using the same slug 'recettes'. This is not recommended as it can cause conflicts in rewrite rules and lead to unexpected behaviors. Using different slugs for the CPT archive and taxonomy base may resolve the issue.

If these steps do not resolve your issue, or if the solution seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum for further assistance.

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.

Tagged: 

This topic contains 41 replies, has 0 voices.

Last updated by Andreas W. 1 week, 3 days ago.

Assisted by: Andreas W..

Author Posts
June 18, 2025 at 4:15 am #17144443

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Can you please try to replicate the reported issue from your last comment on the provided test site?

I created a test post with category and translated them already.

On your test site, the CPT archives lead to:

hidden link
or
hidden link

The CPTs lead to:
hidden link
or
hidden link

June 18, 2025 at 9:38 am #17145416

nicolasG-15

Hi,

It's the same on the parent site. You can see the post "Recipe link test". After publishing or saving, something change the link to .../?recipe_category=test-a instead of .../en/recipes/cat-a-en/test-a/.

June 18, 2025 at 9:53 am #17145458

nicolasG-15

If it's help, it's seem the same as a know issue : https://wpml.org/errata/incorrect-links-for-custom-post-types-and-taxonomies-sharing-the-same-slug/.

June 18, 2025 at 10:09 pm #17148344

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you!

This seems to have a different cause, as the issue also occurs when the slug is not identical between posts, and the workaround is not solving the issue.

I will try to take a local copy of the site for testing and then get back to you.

June 18, 2025 at 11:41 pm #17148392

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I am trying to create a site package using Duplicator PRO, but downloading the package of 1GB seems to take like 8-12 hours.

Could you please reach out to the server administrator or hosting support and ask why the downloads are taking such a long time to process?

In the meantime, I will try to recreate this issue in a new sandbox.

June 19, 2025 at 7:37 am #17148862

nicolasG-15

OK I'll ask support, where do you download the package from? To find out if there are bandwidth restrictions by country.

To reproduce the custom post type structure, see :

/inc/post-types/recipe.php (recipe CPT declaraion)
/inc/taxonomies/recipe-category.php (recipe_category taxonomy declaration)
/inc/hooks/recipe.php/ (from line 284, URL structure modifier like recipe_post_type_link())

June 19, 2025 at 9:27 pm #17152367

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hi!

I created a sandbox, included a CPT with custom taxonomy, and tried to recreate the issue using the Twenty Twenty-One theme.

So far, I can not confirm this issue on a new test site.

I then installed your theme, ACF PRO, and imported your Field Groups, also made sure that the CPT archive and category slugs are translated and the issue still does not occur on this sandbox.

See post "Test" here:

One-Click-Login:
hidden link

Is it possible to deactivate plugins for testing on your provided Multisite?

Best regards
Andreas

June 23, 2025 at 7:29 am #17158248

nicolasG-15

I can't reproduce the issue on the One-Click-Login website. Gutenberg isn't working on it. Due to an error with lodash in global.js theme script.

For confirme the issue you have to :

1. Create a recipe in default language (EN)
2. Add translation of the recipe (DE)
3. Add link of the recipe in other part of the website with Gutenberg (in post for exemple) OR with classic editor

On my site I've deactivated all plugins except translation and ACF.

June 23, 2025 at 8:25 am #17158418

nicolasG-15

For the record, I did some additional tests.
The erroneous modification of a recipe link is only done in a custom post type, post or a page. If you add a link in a taxonomy term, the issue does not occure.
Perhaps we should look at the save_post action.

June 24, 2025 at 7:42 am #17163297

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Take kindly note that I was able to recreate the issue on our sandbox with a CPT and a custom taxonomy and escalated this issue as a bug.

The second-tier support realized that this issue disappears if you go to WPML > Settings > Translate Link Target and run the option to adjust internal links.

Since then, the issue has no longer occurred.

I had earlier mentioned this here:
https://wpml.org/forums/topic/split-modification-of-internal-links-in-gutenberg/#post-17142825

Can you please give this a test on your site? Does this solve the issue on your site?

June 25, 2025 at 7:43 am #17167366

nicolasG-15

I'm sorry but I've just tried twice without success.

You can see with the English version of posts "Test sans Gutenberg" and "Post WPML link test".

June 25, 2025 at 10:28 am #17168684

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

On your test site, it is currently not possible to edit or add new posts.

Is it possible to disable plugins on this Multisite Network to test what is causing this issue?

posts.jpg
June 25, 2025 at 10:56 am #17168846

nicolasG-15

OK let's start from the beginning, you have to "forget" about the first subsite (RCG dispatching) it's just a HUB page for dispatch into the 2 other sites. On the first subsite indeed there is no post, no custom post type you are right.

The posts I talk earlier - and all my tests - is on the second subsite "Professionnal". Here you can do wathever you want.

Same for plugins you have super-admin access rights, I've just checked.

June 25, 2025 at 6:22 pm #17170621

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you for the reminder!

I will keep investigating and then get back to you.

June 26, 2025 at 2:17 am #17171138

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

You’ve used:

'has_archive' => _x( 'recettes', 'Recipe archive slug', 'rcg' ),

and:

'rewrite' => [
  'slug' => 'recettes/%recipe_category%',
  'with_front' => false,
],

This looks like a multilingual slug setup — but _x() is a gettext function, and WPML cannot translate rewrite slugs via gettext (confirmed in WPML docs).

Slug in rewrite is fixed and untranslated
You’ve hardcoded 'slug' => 'recettes/%recipe_category%', but if 'recettes' isn’t dynamically filtered per language, it won’t change when switching languages.

Changing it to this solves the issue but you will need to update the existing translations:

'rewrite' => [
  'slug' => 'recettes',
  'with_front' => false,
],
'has_archive' => 'recettes',