Skip to content Skip to sidebar

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.

Tagged: 

This topic contains 13 replies, has 1 voice.

Last updated by JKJ 1 day ago.

Assisted by: Bigul.

Author Posts
July 24, 2025 at 2:06 pm #17267859

JKJ

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?

July 24, 2025 at 4:15 pm #17268696

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

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?

July 28, 2025 at 6:09 am #17273750

JKJ

I have already given this a try, there are no duplicate slugs in the trash.

July 28, 2025 at 4:37 pm #17276312

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

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.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

--
Thanks!

Bigul

July 30, 2025 at 6:09 pm #17283055

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

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.

https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/using-advanced-translation-editor-when-you-move-or-use-a-copy-of-your-site/

--
Thanks!

Bigul

2025-07-30_23h23_00.png
July 31, 2025 at 8:49 am #17284216

JKJ

Hi,

This is indeed a recently created development site/copy, I have completed the WPML migration wizard.

You can proceed now.

Kind regards.

August 1, 2025 at 6:14 am #17287022

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

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.

--
Thanks!

Bigul

August 1, 2025 at 7:37 am #17287172

JKJ

Hi,

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!

Thanks!

August 4, 2025 at 7:53 pm #17294648

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

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.

--
Thanks!

Bigul

August 6, 2025 at 2:21 pm #17299990

JKJ

Hi,

I have installed the Duplicator plugin on hidden link for you. You have permission to use the plugin to create a copy of the site.

Thanks!

August 13, 2025 at 9:44 am #17316308

JKJ

Hi,

Do you have an update for us?
Can you give us an estimation on how much time you need to debug the issue and hopefully find the cause?

Thanks!
DWD Support

August 13, 2025 at 11:28 am #17317033

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

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.

--
Thanks!

Bigul

August 14, 2025 at 8:19 pm #17322200

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

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.

--
Thanks!

Bigul

2025-08-15_01h46_42.png
2025-08-15_01h04_53.png
2025-08-15_01h04_27.png
August 21, 2025 at 3:08 pm #17338093

JKJ

Hi,

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.

Could you check this issue? Thanks in advance.