Skip Navigation

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

Problem:
If you're experiencing issues with WPML translating CSS IDs, which makes it difficult to know what the links are being renamed to, you're not alone.
Solution:
To prevent WPML from automatically translating CSS IDs, we recommend adding a custom XML configuration to your WPML settings. Here's a step-by-step guide:
1. Navigate to WPML > Settings in your WordPress dashboard.
2. Locate the Custom XML Configuration section.
3. Insert the following code:

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>et_pb_section</tag>
    </shortcode>
  </shortcodes>
</wpml-config>

This code ensures that any CSS IDs you manually edit will not be overwritten, and new pages will not have their CSS IDs automatically translated. It's important to note that this will only affect new translations moving forward; any CSS IDs you've already translated manually will remain as is.

If this solution doesn't seem relevant to your issue, please don't hesitate to open a new support ticket with us.

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.

This topic contains 11 replies, has 2 voices.

Last updated by Laura 1 year, 4 months ago.

Assisted by: Laura.

Author Posts
November 7, 2023 at 9:47 am #14745315

nicoC-8

Many thanks for your help. Yes that did work and I've managed to update all the translations. I'm having one other issue which I hope you don't mind addressing within this thread.

It's actually translating the CSS IDs which means I don't know what it is renaming my links to be. Is there a place where I can find where these CSSID translations have been done and correct them?

November 7, 2023 at 3:49 pm #14749575

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Hi,

thanks for contacting us.

I see you're using Divi, and by default CSS IDs coming from Divi are not translatable.

You'll need to enable the translation with some custom XML.
See https://wpml.org/forums/topic/how-can-i-prevent-wpml-ate-from-translating-css-ids/#post-13467995

The et_pb_section you see is the name of the module, you may need to change this with the module you're having issues with.

November 8, 2023 at 7:44 am #14753189

nicoC-8

H Laura,

I think you misunderstood I've got the opposite problem. I've actually got the issue that WPML is translating CSS IDs and I don't want it to. I want to leave CSS IDs untranslated.

Could you please let me know the switch all the code which can stop WPML from translating CSS IDs

November 8, 2023 at 11:42 am #14755883

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

WPML shouldn't translate CSS IDs.

Could you please give me an example where this happens?

November 8, 2023 at 11:56 am #14756127

nicoC-8

It doesn't happen all the time but sometimes it opts to translate. I had one with a css id titled features in the english original - in the translated version the CSS ID say eigenschaften

November 8, 2023 at 12:01 pm #14756145

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

If it happens "sometimes" it might depend on the specific module used by Divi.

Please, I need a *real* example, e.g a link to a page where it happens, it's not possible to tell you anything from a generic description of the issue.
I'll have to access your site to further check the problem.

November 8, 2023 at 1:19 pm #14757037

nicoC-8

It seems only to happen when the anchor is attached to a section. At the moment I've gone through and renamed all the translated IDs in the German version. It's just my fear that if I do an auto translate again it will do the same thing and break some links

Screenshot 2023-11-08 at 14.15.01.png
Screenshot 2023-11-08 at 14.18.01.png
November 8, 2023 at 7:29 pm #14760865

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

If you changed them manually they won't be overwritten. New pages will have the same issue.

Please add this in WPML > Settings > Custom XML config and you should solve the problem

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>et_pb_section</tag>
    </shortcode>
  </shortcodes>
</wpml-config>
November 10, 2023 at 6:20 am #14772415

nicoC-8

Your last answer seems to be contradictory - You say the css ids won't be overwritten and then give me a solution for them being over written.
Just to confirm after I changed the CSS ID in the German version and then ran a translation again it once again replaced it with a German version of the word.

November 10, 2023 at 12:14 pm #14776247

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

The code I provided is to avoid automatic translation of CSS IDs.

Nothing will happen to the IDs you edited manually. Only the IDs in the posts you'll translate from now on will be copied and not translated.

November 10, 2023 at 12:17 pm #14776293

nicoC-8

Okay I have put the code in and I will doublecheck after I've done some more translations. I'll leave the ticket open for the moment because I'm not planning to change anything right now.

November 10, 2023 at 12:29 pm #14776389

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Ok, the ticket will close automatically in 2 weeks