[Resolved] Menu synchronization not working properly
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is trying to synchronize and create translated menus automatically using WPML, following the documentation at https://wpml.org/documentation/getting-started-guide/translating-menus/. However, after synchronization, the translated English menus are empty, and the main menu displays both German and English links, which is not the intended outcome. Solution: We suspect there might be a compatibility issue with WP Grid Builder Multilingual, which is not directly handled by us. We recommend setting up a test environment to replicate the issue. Please install WP Grid Builder and its Multilingual add-on on the provided test site at https://shiny-cabasa.sandbox.otgs.work/?auto=N32k06wJkDOPYSF9hNEVqbHUnDcGAwsy and notify us once the plugins are installed so we can further investigate.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable 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. Should you need further assistance, please open a new support ticket 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.
Background of the issue:
I am trying to synchronize and create translated menus automatically. I followed the documentation under https://wpml.org/documentation/getting-started-guide/translating-menus/ and translated the custom links and strings as suggested. I have a German site, and when I press sync, the English menus are created.
Symptoms:
The translated English menus all have no entries. Instead, my main menu then had the German and English links, which is not the desired outcome.
Questions:
Why are the translated English menus empty after synchronization?
How can I avoid translating all menus manually?
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. Have you translated the pages before trying to translate the menu? If you are adding items as pages to the German menu, you will need to make sure that those pages have been translated or else there is nothing to add to the English menu.
For Custom Links, you can go to Appearance -> Menus and use the admin language switcher to switch to English. Then you should be able to see the English menus and edit them. Do you see any menus there? Are there custom links or pages added on the backend?
Hey,
I have translated the pages already.
When I switch to English I can see the English menus but most of them do not have any links added although the pages are all translated.
My expectation was that the menus are created and then the pages are added to them automatically. However most of them are completely empty, except one of them.
There are custom links which were translated as well. I have tried deleting the english menus and syncing again however only the menus are created, no menu items were added.
If the menu items are added as custom links, then they will not sync and you will need to add the links. This is becuase a custom link item does not know how to translate the link. It could link to essentially anything, even something outside your site. If you link to categories or pages instead of custom links, then the sync would work. Otherwise, you can use that admin switcher to switch language and add the custom links to your secondary language.
Some menus do not even contain custom links. And even if they did, your documentation suggests that I can just translate the strings. I have some menus where I have three custom post types linked which have a valid permalink but the english version is just empty.
the pages are translated, though.
I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.
Our Debugging Procedures
I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.
- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link
I can see the issue that is happening on the backend when I try to synchronize a menu. The next thing we will need to do is check for any backend errors by enabling the debug log. I will send instructions to do this below. The other thing to test is minimal settings, meaning test with only WPML plugins active with a default theme. Do you have a staging site where we can test that? If not, perhaps your hosting provider can create one for you, or you can use WP Staging or something similar. If that doesn't work, let me know and we can set one up for you and get a copy of your site to test there.
WordPress includes a debug mode that helps reveal PHP problems. Let's enable this and see if there are any errors we can locate.
To enable it, open your wp-config.php file and look for
In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.
The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.
If you open wp-config.php and that define statement is not there, you can add it right before this line:
/* That's all, stop editing! Happy blogging. */
Please note that you’ll see everything, not only related to our Plugins. This will most likely include messages from other plugins, your theme, and sometimes even WordPress core. The messages appear all over the place.
Sometimes they appear right on top, but they can also appear in the middle of the page.
After enabling the debug mode, please try to replicate the issue. Navigate to the page where the error message being displayed. The errors will be either displayed on the screen or logged in the debug.log log file inside the /wp-content/directory.
Paste the latest lines here. No need to paste the entire log file, just 50 lines or so will do. Please censor any sensitive information.
Thanks for running those tests. We do not handle the WP Grid Builder Multilingual, so this may be a compatibility issue. I have set up a test install and configured WPML. Here's a link to login: hidden link
Please install the WP Grid Builder and the Multilingual add on so we can see if we are able to reproduce the issue in a clean install. Let me now once you have those plugins installed and we can further test on this test site.
Hey Lauren,
thank you for your support. Honestly, as the menu sync also collides with Bricks Builder mega menus (they don't show up unless you add an entry manually) I will just set them up manually.
Also acf fields from my menu items were not synced as well. This is too much hassle for something we won't change too often.