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.

This topic contains 3 replies, has 3 voices.

Last updated by Andrey 3 months, 2 weeks ago.

Assisted by: Andrey.

Author Posts
August 5, 2024 at 9:27 pm #16042128

nickS-28

Background of the issue:
I am trying to find out where WPML stores URL slugs in the database so they can be changed manually.

Symptoms:
No specific issues, errors, or unexpected behavior reported.

Questions:
Where does WPML store URL slugs in the database?
How can I change URL slugs manually in the database?

August 6, 2024 at 7:25 am #16042646

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

WPML doesn't store them, it only keeps language information.
https://wpml.org/documentation/support/wpml-tables/

Slugs are stored in wp_posts, within post_name field.

August 6, 2024 at 8:15 am #16042822

nickS-28

How can I change faulty slugs manually in the database?

Example:
hidden link

should be (without the "-2"):

hidden link

I used to make such changes via this plugin:
https://wordpress.org/plugins/better-search-replace/

However, the Siteground (the host) has limited/disallowed the use of the plugin.

They have an in-house tool that is supposed to fulfil the same function, but unfortunately does not.

Here, there explanation for reference:

That would be because the "londres-2" string does not exist in the website's database as seen in the checks below.

baseos | pianobook.io | u1180-i3kffbqtkanj@gfram1024.siteground.biz:~/www/pianobook.io/public_html$ wp db search 'pianobook.io/pt/listings/piano-bar/londres-2' | wc -l
Warning: No text columns for table 'YgoKQndmterm_relationships' - skipped.
0

baseos | pianobook.io | u1180-i3kffbqtkanj@gfram1024.siteground.biz:~/www/pianobook.io/public_html$ wp db query "SELECT * FROM YgoKQndmposts WHERE post_content REGEXP 'londres-2' OR post_title REGEXP 'londres-2' OR post_excerpt REGEXP 'londres-2';" | wc -l
0

Below you can see how one of these checks looks like when results are found for the given string of which the search is being made.

baseos | pianobook.io | u1180-i3kffbqtkanj@gfram1024.siteground.biz:~/www/pianobook.io/public_html$ wp db query "SELECT * FROM YgoKQndmposts WHERE post_content REGEXP 'londres' OR post_title REGEXP 'londres' OR post_excerpt REGEXP 'londres';" | wc -l
28

These URLs appear to be generated by the WPML plugin, hence they don't seem to be canonically stored in the database of the website but are instead generated by the plugin when the content is requested in a specific language, which is why utilizing the wp search-replace command does not change them.

That being said, I will recommend reviewing the settings of this plugin and changing them accordingly as this should allow you to achieve the desired end results here. We can further assist you with this task through our Expert Care Service, which you can request from your Client Area > (?) View Help Center > Contact Us > Expert Care Services > WordPress - Do It For Me > I have other WordPress request.

If you require assistance with anything else, let us know via a new support enquiry from your Client Area.

Best regards,

Ivaylo Stoyanov
Technical Support Team

August 6, 2024 at 2:13 pm #16044392

Andrey
Supporter

Languages: English (English ) Russian (Русский )

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

If they relate to post types, the URLs are stored in the WordPress database tables, specifically in the wp_posts table. WPML does not generate them dynamically. If you cannot find them or cannot use plugins to modify the database directly, it's best to consult with the hosting provider.

I suggest avoiding making direct changes in the database and instead using the WordPress dashboard to change the needed URLs.