Skip Navigation

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

Problem:
When translating a block theme, specifically the 'Header' template and 'Navigation Menus', some URLs in the secondary language do not update with the language code and translated slug, while others link to the primary language without a language prefix.
Solution:
First, ensure that when using the WordPress block 'Custom Link', you include the entire URL for the link, not just the slug (e.g., /articles). After updating the URL, resend the 'Navigation Menu' for translation. This should make the URL field appear correctly in the translation interface.
It's important not to use the Site Editor to edit the Navigation in a second language. Instead, always use the Translation Management and translate the Navigation with the WPML Translation Editor. Here's how:
1. Go to WPML > Translation Management > Dashboard.
2. If 'Click filters' is visible, click it to see all the site's content.
3. Create a job for your Navigation Menu and access it at WPML > Translations.
4. When translating the navigation, you can translate the links on the WPML Translation Editor.

If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket if the problem persists. For further assistance, visit our support forum at WPML Support Forum.

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 9 replies, has 1 voice.

Last updated by beatS-3 2 months ago.

Assisted by: Andreas W..

Author Posts
February 26, 2025 at 5:07 pm #16752413

beatS-3

Background of the issue:
I am working on a site under development using a block theme. I translated the 'Header' template part and my menu under 'Navigation Menus'.

Symptoms:
When switching to the secondary language, only some URLs are updated with the language code and translated slug, while others link to the primary language without a language prefix.

Questions:
What is the workflow to make a changed slug in the secondary language show up on the frontend?
Have any developers actively used WPML with a block theme in a real-world example?
Is there a dedicated page in the docs with in-depth step-by-step explanations of the entire workflow to translate a block theme?

February 26, 2025 at 6:42 pm #16752911

Lucas Vidal de Andrade
WPML Supporter since 11/2023

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with first debugging steps or if I can perhaps help with the issue quickly.

If you are talking about standard WordPress menus, the ones you find under appearance, you can follow the steps here to translate them:
https://wpml.org/documentation/getting-started-guide/translating-menus/

It's a local website, so I couldn't check it. But since only some menu items are translated, there are two things that might be causing that:

1. Not all pages are translated. For a menu link to be translated, the page's translation must exist and be published on your website
2. The inserted links are custom links. In this case, WPML won't translate them automatically. You'll need to translate the custom links in WPML > String Translation.

If that does not help, one of my colleagues will soon come to continue support. Also, please share the exact steps you took to translate the menu, and any specific details you find useful.

February 26, 2025 at 6:57 pm #16753099

beatS-3

Dear Lucas, appreciate your feedback.

As the title of my post suggest: It's a block theme, not a classic theme.

And as I said, the Navigation Block menu item labels are translated correctly. SOME site URLs are also translated, but some are NOT. However that works in the backend.

Additionally, within the Navigation Block I added a "Custom Link" Block that needs to be translated (its URL). How would that work using "String Translations"? What "Domain" would that be assigned to?

Thanks for looking into this!

March 1, 2025 at 4:46 pm #16764200

Andreas W.
WPML Supporter since 12/2018

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

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

Hello,

When working with the Site Editor on a Block Theme using WPML it is important to edit your templates, template parts, and navigation menus in the site's default language only.

These post types will then get translated by going to WPML > Translation Management.

If you do not follow this workflow you might experience unexpected issues. In such case, you need to open the Site Builder while having the admin language set to your second language and delete the manually translated templates, template parts, or navigation menus.

Possible issue:
https://wpml.org/errata/template-is-not-applied-to-translated-page/

Best regards
Andreas

March 3, 2025 at 11:53 am #16768903

beatS-3

Dear Andreas,

Thank you very much, this article pointed me in the right direction.

What I still don't get is:

When I update the slug of a page, it makes sense to me that I need to update the translations of the page itself, and the navigation.

But this page is obviously linked on many pages, posts, template parts and patterns.

What is the workflow to update the slug website wide?

Thanks for you help!

And a Suggestion:

How about creating a "The ultimate Guide to WPML and Block Themes" tutorial? I'm sure you're hit by more and more people wanting to translate a block theme, and it would only make sense to clearly document all block theme workflows, which you then can point people to?

March 3, 2025 at 3:09 pm #16769650

beatS-3

Another navigation issue popped up:

I have a "Custom Page" block within the "Navigation Block". Sometimes the translation works, and then it switches back to the primary language. Super annoying!

And when I update the Navigation and Header Section, all slug translations are removed.

Meanwhile, the site is live, and I start becoming afraid of making changes as they will break the site. This is frustrating.

What exact order of sending items for translation do I need to follow so it won't break my site?

Thanks for your support.

March 4, 2025 at 3:58 pm #16775084

Andreas W.
WPML Supporter since 12/2018

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

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

Is the Navigation Menu currently translated at WPML > Translation Management?

Go to WPML > Translation Management > Dashboard and use the dropdown on the top left to filter for the post type "Navigation Menu".

If the menu's translation is not completed, create a job for the menu and access it a WPML > Translation to translate with the WPML Translation Editor.

Do the same for the header template, if needed.

If this will not solve the issue, please let me know.

March 4, 2025 at 4:03 pm #16775128

beatS-3

Both the "header" template part and the navigation menu "Main Menu" are sent for translation and are completed.

Screenshot 2025-03-04 at 17.02.43.jpg
March 4, 2025 at 4:43 pm #16775276

Andreas W.
WPML Supporter since 12/2018

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

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

This means the issue must be related to your "Custom Page" block.

I see you use various custom plugins that affect block creation and display conditions.

Take kindly note that usually, our support does not cover debugging custom code issues but I can offer to take a closer look and see if I can figure out what is causing the problem.

Do you maybe have a staging or development site available that I could use for testing?

If so, let me know and I will enable a private reply form in which you can provide access to the site.

Alterantively I could offer a WPMl test site on which you could install the custom plugins for testing.

March 4, 2025 at 5:01 pm #16775312

beatS-3

Thank you so much! I really appreciate your offer.

I just set up a staging site with the cloned website.

Let me know how I can send you the login info.

March 4, 2025 at 6:30 pm #16775615

Andreas W.
WPML Supporter since 12/2018

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

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

I would like to request temporary access (wp-admin and FTP) to the site to investigate the issue further.

The required fields are below the comment section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.

IMPORTANT
Please be sure to back up the site and database before granting us access.

If you can't see the "wp-admin / FTP" fields, your post and site login details will be set to "PUBLIC". DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private reply form looks like this:
hidden link

The next time you reply, click on "I still need assistance".

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We are not allowed to access any credentials that were not specifically submitted on this ticket in the private response form.

March 4, 2025 at 11:18 pm #16776199

Andreas W.
WPML Supporter since 12/2018

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

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

My apologies, but I was misunderstanding the issue, as I expected that there was a Custom Block inside the Header that you coded yourself.

I can only see a Logo and a Navigation Block. Inside this Navigation Block are Page Links and one Custom Link (Articles).

If you still translate the slugs of your pages, you will need to update the translation for your Navigation.

Important:

Do not use the Site Editor to edit the Navigation in a second language. Always use the Translation Management and translate the Navigation with the WPML Translation Editor.

Go to WPML > Translation Management > Dashboard. If "Click filters" is visible, click it to see all the site's content.

Create a job for your Navigation Menu and access it a WPML > Translations.

When translating the navigation you can translate the links on the WPML Translation Editor.

See screenshot.

translation editor.jpg
March 5, 2025 at 12:56 pm #16778664

beatS-3

Hi Andreas

Thanks for your feedback.

That's strange, the "Navigation Link" URL field for "Articles" was not visible for me (see first screenshot) on my local install, and I am most certain that it wasn't on my live site.

Solution:

I noticed, that in the native WordPress block "Custom Link", I did not use the entire URL for the link, but only the slug like (e.g. /articles).

Adding the page's URL and re-sending the the "Navigation Menu" for translation did the magic: The URL field finally appeared (see second screenshot)!

This might be a bug? Can you reproduce that?

Hope that helps someone out there.

Screenshot 2025-03-05 at 13.50.37.jpg
Screenshot 2025-03-05 at 13.46.22.jpg
March 5, 2025 at 12:57 pm #16778694

beatS-3

I'm closing this.

Thanks again for looking into it! Appreciate you taking time.