This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to edit a link in a button using the Gutenberg editor, but after saving and reloading the page, the URL unexpectedly changes to include '-2'. This issue does not occur when WPML is deactivated.
Solution:
The issue was due to an old entry in the database where the post_name in the wp_posts table was incorrectly set. We corrected this by updating the database entry to the correct post_name. You can apply a similar fix by running the following SQL command in your database:
UPDATE `wp_posts` SET `post_name` = 'desired-post-name' WHERE `wp_posts`.`ID` = your_post_id;
Replace 'desired-post-name' with the correct name of your post and 'your_post_id' with the ID of the post you are updating.
If this solution does not resolve your issue, or if it seems outdated or irrelevant 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. Additionally, you can open a new support ticket for further assistance 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 edit a link in a button on the page hidden link. Specifically, I want to change the link from hidden link to hidden link using the Gutenberg editor. This happens on multiple pages.
Symptoms:
After saving and reloading the page, the URL changes unexpectedly to hidden link. When I deactivate WPML, the URL change works as expected.
Questions:
Why does the URL change to include '-2' after saving and reloading?
How can I prevent WPML from altering the URL?
Thank you for reaching out to WPML support. While one of my colleagues picks up this ticket, I’d like to provide some initial debugging steps to assist you right away.
The issue you're seeing typically occurs when there are multiple pages with the same URL slug. The “-2” suffix indicates that a duplicate slug already exists. Please check the trash for that post type in your primary language and delete any pages with the same slug.
Once the duplicate is removed, you should be able to use the original slug without the “-2” being appended. Could you give this a try and let us know if it resolves the issue?
Thank you for the updates. This issue requires further investigation. To help us track it more effectively, we have a couple of requests:
1) Please share the exact steps to reproduce the issue on your site. If possible, provide a screencast demonstrating the issue. This will give us a clearer understanding and also assist in our internal discussions.
2) Please fill the private details fields after a full site backup. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our private information sharing policies.
Thank you for the details and for providing the login information. I have one question for clarification: Is hidden link your staging site, recently created for development purposes?
I ask because the site is showing the following warning: “WPML detected a new address for this site”. This typically appears when a site has been migrated, its URL has changed, or when a copy of the live site is made.
To ensure WPML works correctly, you will need to complete the WPML migration wizard. Please refer to the following documentation and attached screenshot for more details, and let us know your feedback.
Thank you for the updates. I performed a quick test after upgrading to the latest version of the plugins, and the issue still exists. To ensure the problem is not caused by a compatibility conflict, I would like to verify whether the bug occurs in a minimal setup.
Could you please let us know which plugins are required for the proper functioning of your customized theme (Cadran)?
Also, does the issue occur only on the following URL, or are other posts affected as well?
hidden link
Additionally, please allow me to install the Adminer plugin to perform further database-level checks if necessary.
Could you please let us know which plugins are required for the proper functioning of your customized theme (Cadran)? -
The required plugins are
DWD WP SNIPPETS
DWD WP STRUCTURED DATA
Gutenberg
WPML plugins
Yoast SEO
Also, does the issue occur only on the following URL, or are other posts affected as well?
- There are some other posts which are affected, but it's very specific.
Additionally, please allow me to install the Adminer plugin to perform further database-level checks if necessary.
- That's ok!
Thank you for the details and permission. I performed a few rounds of testing, but the issue persists. Therefore, it may need to be escalated to our second-tier team for further investigation.
To proceed, please allow me to create a copy of your site using the Duplicator plugin. This will help us debug the issue in deep on our local server.
We are still investigating this issue, and the possible workarounds haven’t resolved it so far. It may be related to a compatibility conflict. We will keep you updated and get back to you as soon as possible. Thank you for your patience and understanding.
It appears that the issue was caused by an old entry in the database for the following post, where the post_name in the wp_posts table was set to "netsuite-wms-2".
hidden link
After correcting it to "netsuite-wms", the button URL is now working as expected: hidden link
UPDATE `wp_posts` SET `post_name` = 'netsuite-wms' WHERE `wp_posts`.`ID` = 10218;
Please check it now and let us know your feedback. Refer to the attached images for more details.
We checked internally for why the issue is happening and what could be the cause of this. We found a reproducable issue which our client is also experiencing.
When changing the button URL on hidden link for "learn more about netsuite wms", the button URL is changed back immediately after saving. We are changing the button URL from hidden link to hidden link.
It seems like both URL's are working from the permalinks we have added, but the button URL should still change when we are saving the new value and we save the post. However, what is happening is the following:
1. We change the button URL to a new value
2. We save the post
3. A revision is created with the new value
4. 1 second later, a new revision is created changing the new value to the old value of the button URL
We have tested this with post hidden link. You can check revisions hidden link and hidden link for the automatic changes that are happening.