Skip Navigation

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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - -
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - -

Supporter timezone: Asia/Jerusalem (GMT+02:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Itamar 2 years, 1 month ago.

Assisted by: Itamar.

Author Posts
December 4, 2022 at 3:19 pm #12586543

michaelC-105

CONFIDENTIAL
Tell us what you are trying to do?
Our site is translated in more than 20 languages. When we add new pages, we have a seriously problem with menu sync which bugs.

Is there any documentation that you are following?
https://wpml.org/documentation/getting-started-guide/translating-menus/#option-1-translating-menus-automatically

Is there a similar example that we can see?
hidden link Many doing business in pages do not appear into the menu list of translated pages. So into translated pages, if you browse the list of "Doing business in" you will see that translated menu items don't show up
What is the link to your site?
hidden link
This ticket must stay private: I don't want to see our tickets on google when any user types our brand.

THIS IS ADVICE GIVEN BY SUPPORT
https://wpml.org/forums/topic/menu-sync-doesnt-work/

THIS IS WHAT WE DID
hidden link
hidden link
hidden link

I have deactivated all the plugins except WPML Plugins. I have activated Twenty Twenty One Theme and the issue is still there.
The website will be a complete mess now because the Divi Theme is deactivated now.

I have also updated all the plugins to the latest version, all the Themes to the latest version and WordPress to the latest version also.

But the issue is still there.

December 5, 2022 at 2:07 pm #12591955

michaelC-105

Hi i did not get any answer to our problem.
Please help.

December 6, 2022 at 8:45 pm #12602213

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I'll continue to help you with this issue.

Thanks for creating a staging site where we can investigate this issue further.

If you need further help, please share the access details to your staging site with me. I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --

Regarding your concern about your brand being exposed to Google searches. Don't worry about that because the links you shared with us are hidden from Google. They are only visible to you and us, the support team.

Regards,
Itamar.

December 7, 2022 at 1:10 pm #12607023

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks, Michael.

I've created a Duplicator package (Duplicator was installed on your site) of your site and will continue to debug this issue on my local server. I'll keep you updated on any news regarding this issue.

Thanks,
Itamar.

December 8, 2022 at 6:11 pm #12616999

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I escalated this issue to our second-tier supporters. When I have news from them regarding this issue, I'll update you here.

Thank you for your patience.
Itamar

December 11, 2022 at 5:07 pm #12629897

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our second-tier supporter has recognized the issue. There seems to be a performance issue with a site containing many languages and menus. This issue has been escalated to our developers, they will address this issue and try to fix it in future versions of WPML. Meanwhile, there is a workaround suggested by our second-tier supporter that you can apply to your site. The workaround will improve the loading time of the WP Menu Sync page. I checked on the copy of your site, and it works. here is what you need to do.

1. Take a full backup of your site in case something goes wrong.

2. With a code editor or in Plugins -> Plugins File Editor, edit this file:
/wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/menus-sync.php

3. On line 88, replace this function:

function get_menus_tree() {
		global $sitepress, $wpdb;

		$menus = $wpdb->get_results(
			$wpdb->prepare(
				"
            SELECT tm.term_id, tm.name FROM {$wpdb->terms} tm 
                JOIN {$wpdb->term_taxonomy} tx ON tx.term_id = tm.term_id
                JOIN {$wpdb->prefix}icl_translations tr ON tr.element_id = tx.term_taxonomy_id AND tr.element_type='tax_nav_menu'
            WHERE tr.language_code=%s
        ",
				$sitepress->get_default_language()
			)
		);

		if ( $menus ) {
			foreach ( $menus as $menu ) {
				$this->menus[ $menu->term_id ] = array(
					'name'         => $menu->name,
					'items'        => $this->get_menu_items( $menu->term_id, true ),
					'translations' => $this->get_menu_translations( $menu->term_id ),
				);
			}

			$this->add_ghost_entries();
			$this->set_new_menu_order();
		}
	}

With this:

function get_menus_tree() {
		global $sitepress, $wpdb;

		$menus = $wpdb->get_results(
			$wpdb->prepare(
				"
            SELECT tm.term_id, tm.name FROM {$wpdb->terms} tm 
                JOIN {$wpdb->term_taxonomy} tx ON tx.term_id = tm.term_id
                JOIN {$wpdb->prefix}icl_translations tr ON tr.element_id = tx.term_taxonomy_id AND tr.element_type='tax_nav_menu'
            WHERE tr.language_code=%s
        ",
				$sitepress->get_default_language()
			)
		);

		if ( $menus ) {
			foreach ( $menus as $menu ) {
                $menuproc = get_transient("menu_term_id". $menu->term_id );
                if (empty($menuproc)) {
                    $this->menus[$menu->term_id] = array(
                        'name' => $menu->name,
                        'items' => $this->get_menu_items($menu->term_id, true),
                        'translations' => $this->get_menu_translations($menu->term_id),
                    );
                    set_transient("menu_term_id". $menu->term_id, $this->menus[$menu->term_id] );
                } else {
                    $this->menus[$menu->term_id] = $menuproc;
                }


			}

			$this->add_ghost_entries();
			$this->set_new_menu_order();
		}
	}

4. Save the change.

Now the problem should improve. You should be able to access the WP Menu Sync page.

I'll keep you updated on any news regarding this issue.

Thank you for your patience.
Itamar.

December 14, 2022 at 1:25 pm #12650231

michaelC-105

The problem is like you guys offer the option to translate in different languages. But, it seems to me you did not make bulk management easy. So, i'm suffering a lot. And, it is really time consuming.

December 14, 2022 at 4:19 pm #12651941

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I'm sorry, but what you are trying to translate automatically are custom menu items, which can not be translated automatically. You can read more about translating custom menu items here.

https://wpml.org/documentation/getting-started-guide/translating-menus/#translate-custom-links

It is possible to send strings to automatic translation. You can read about it here.

https://wpml.org/documentation/getting-started-guide/string-translation/#translating-strings

But the problem is with internal links. There is no way that the automatic translation can "guess" the correct translated link.

However, if you change those custom menu links to regular menu links, WPML should handle them correctly, and you will not need to translate those menu items.

As for links with #, I guess you can simply copy the # sign to the translation. I'm not sure if this can be done automatically.

As for links with actual strings like "Partnerships", I guess that you can send them to automatic translation. But I'm unsure if the translation will work for you in the menu. I do not know what those strings are. If they anchor IDs, then you will need to ensure that the anchor IDs on the translation are also translated the same. If it is for JS code, then you will also need to handle this through the JS code.

I understand how much manual work you must do regarding translating the menus when you have 30 languages on your site. And I know how time-consuming it can be. But I'm sorry, with how WPML works, there is nothing else I can suggest other than what I wrote above.

I'll keep you updated on any news regarding the escalated issue with our developers.

Regards,
Itamar.