Skip to content Skip to sidebar

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

Problem:
The client reported an issue where spaces at the beginning and end of text elements in UXBuilder were being removed after translation with WPML. This was observed in both UXBlocks and Pages using UXBuilder, affecting the layout and spacing as intended by the client.
Solution:
We clarified that the removal of spaces is not specifically related to WPML but is a behavior of WordPress itself. When content is saved or updated using the Gutenberg editor, WordPress automatically removes any leading or trailing spaces in text modules. We recommended testing this behavior on a sandbox site with WPML deactivated to confirm that it occurs even without WPML active. If you're experiencing this issue, we recommend checking this behavior in your setup.

Please note that this solution might be outdated or not applicable to your specific case. If the issue persists, 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 necessary, 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.

This topic contains 5 replies, has 0 voices.

Last updated by Kor 5 months, 4 weeks ago.

Assisted by: Kor.

Author Posts
October 10, 2025 at 8:23 am #17473717

michaelR-151

Hi Kor.

This is a V, better known as a check mark. I put them on the two elements in question and translated. See clip.

Yes, I am asking you if it is not WPML plugins job to just translate text and graphics and sync structore from prim. lang to translated lang. when I SAVE in UXBuilder? Asking because it did not, and I fixed it kind of manually with the 2 x V checkmarks and a re-translation from the Dashboard.

Yes WPML has an error with spaces in prim. lang. translating to other lang. Try this in your test setup or try it on my site (ignore the ", they are there so you can see the spaces):

Example A. in UXBlocks =
Make a text in UXBlocks like this = "Kor er en dygtig supporter WOW!"
Result from WPML in UK lang. = "Kor is a brilliant supporter WOW!"

This is a problem, because when I want 3 or 5 spaces, I actually want that. I can fix it by changing the WPML translatede sub sites after the translations, but why should I have to do this. 99% of the time a WPML user wants the same layout in all languages, and if not it is better to have the works with that in 1% of the time.

Example B. in Pages with UX Builder =
Make a text like this = " Ny computertaske? "
Result from WPML in UK lang. = "New laptop bag?"

This one you can se live by us on hidden link and hidden link which is a problem. I made a space in start end end of text on the two top pictures on purpose and I want a space there. WPML tangles with my idea and removes my spaces.

That was what I ment.

Are my questions more clear now?

October 13, 2025 at 3:37 pm #17480521

Kor

Thanks for your patience. I tested with the default Gutenberg editor and saw the same behavior. Adding spaces at the start of a word does not work.

You can check it here hidden link
. Just edit the text, save, and reload the page. No translation is required to reproduce it.

Insert spaces before and after a word. The leading spaces are removed, while a single trailing space remains. If you add two or more trailing spaces, all trailing spaces are removed.

You can log in to the sandbox here hidden link

October 20, 2025 at 8:40 am #17498488

michaelR-151

Hi Kor.

If I understand you right, you get the same error as me, spaces are removed, correct?

Therefore the originale primary site language design is altered, with no reason. All characters shold survive to the translated sub sites.

You then talk about a sandbox?

I do not find a solution in your answer? Am I understanding this right?

Regards Michael

October 20, 2025 at 3:49 pm #17500300

Kor

Thanks for your reply.

I think there’s been a misunderstanding. What I meant is that this issue occurs even without WPML. You can test it on our sandbox site hidden link with WPML deactivated, you’ll see that whenever you save or update a page, any spaces at the beginning of a Gutenberg page editor text module are automatically removed.

Could you recheck?

October 20, 2025 at 5:19 pm #17500549

michaelR-151

Thank you also Kor.

Aha, that make sense. I understand. So it is a WordPress thing, it deletes spaces.

If this is th case, then I will avoid those leading spaces.

Thank you!

/Michael

October 20, 2025 at 5:24 pm #17500552

Kor

Thanks for your reply. Glad that helped. Closing this ticket. Have a great day!