Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.
Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe du WPML répond sur le forum 6 jours par semaine, 22 heures par jour.
Marqué : Bug
Ce sujet contient 7 réponses, a 1 voix.
Dernière mise à jour par Łukasz Rydygel Il y a 3 semaines et 3 jours.
Assisté par: Łukasz Rydygel.
| Auteur | Messages |
|---|---|
| janvier 23, 2026 à 9:09 am #17756325 | |
|
benjaminK-50 |
Bonjour, |
| janvier 23, 2026 à 9:13 am #17756359 | |
|
benjaminK-50 |
Je viens de lancer une traduction automatique et c'est une catastrophe. Exemple numéro 1 : Les slugs se dupliquent alors que cela ne devrait pas se dupliquer ce qui fait que j'ai des doublons ou des triplons... Exemple numéro 2 : Il santuario di Delfi: la storia, l’oracolo di Apollo e l’eredità di un’antica meraviglia Das Heiligtum von Delphi: Geschichte, Orakel des Apollon und das Erbe eines antiken Wunders Les articles ont étés traduit, mais les slugs sont en français.... |
| janvier 23, 2026 à 9:17 am #17756367 | |
|
benjaminK-50 |
Comme vous pouvez le constatez dans les sitemaps, tous les nouvelles urls sont en français... |
| janvier 23, 2026 à 10:51 am #17756749 | |
|
Łukasz Rydygel Supporter Les langues: Anglais (English ) Allemand (Deutsch ) Fuseau horaire: Europe/Warsaw (GMT+01:00) |
Hello Benjamin, thank you for reaching out. I am a WPML developer and I will try to help resolve this issue. To make the support process smoother and avoid misunderstandings, I kindly ask if we could continue this discussion in English. As a first step, could you please provide a Duplicator package of your site? This will allow us to reproduce the behavior on our systems and investigate the problem more accurately. Thank you very much for your cooperation. I’m looking forward to your reply. Best regards, |
| janvier 26, 2026 à 1:15 pm #17762487 | |
|
Łukasz Rydygel Supporter Les langues: Anglais (English ) Allemand (Deutsch ) Fuseau horaire: Europe/Warsaw (GMT+01:00) |
Hello Benjamin, alternatively, you are welcome to provide us with temporary access credentials. In that case, we can create the Duplicator package ourselves and investigate the issue directly on our end. Please let us know which option works best for you. Thank you for your cooperation. Best regards, |
| janvier 27, 2026 à 9:56 am #17766096 | |
|
benjaminK-50 |
Hi Lukasz Duplicator may not work as the site is pretty heavy and i've faced a few timeout issues - before. Would that work for you ? |
| janvier 27, 2026 à 10:44 am #17766280 | |
|
Łukasz Rydygel Supporter Les langues: Anglais (English ) Allemand (Deutsch ) Fuseau horaire: Europe/Warsaw (GMT+01:00) |
Hello Benjamin, we don’t need everything for now — you can leave out the uploads folder and any plugins that aren’t strictly required. That should reduce the size and help avoid timeout issues. If that still doesn’t work smoothly, we’re happy to go with the alternative approach using the wp-content.zip and a database dump. Let me know what works best on your end. Best regards, |
| janvier 29, 2026 à 12:10 pm #17773375 | |
|
Łukasz Rydygel Supporter Les langues: Anglais (English ) Allemand (Deutsch ) Fuseau horaire: Europe/Warsaw (GMT+01:00) |
Hello Benjamin, we were able to confirm the behavior you described. Since URLs are not translated automatically, we recommend enabling the option to automatically generate URLs from post titles for future content. This will ensure that translated posts receive correctly localized URLs going forward. As this setting cannot be applied retroactively, we have prepared a script for you. The script will regenerate the URLs for already translated posts based on their respective titles. function wpml_fix_translated_slugs_with_suffixes()
{
// Only execute if the URL parameter is set and the user is an admin
if (is_admin() && !current_user_can('manage_options')) {
return;
}
// Configuration: Define which post types to check
$post_types = array('post');
$count_updated = 0;
$all_posts = get_posts(array(
'post_type' => $post_types,
'posts_per_page' => -1,
'post_status' => 'any',
'suppress_filters' => true, // Bypass WPML language restrictions to get all posts
));
foreach ($all_posts as $post) {
$details = apply_filters('wpml_element_language_details', null, array(
'element_id' => $post->ID,
'element_type' => 'post_' . $post->post_type
));
if ($details && !empty($details->source_language_code)) {
// Find the ID of the original post
$original_post_id = apply_filters('wpml_object_id', $post->ID, $post->post_type, false, $details->source_language_code);
if ($original_post_id && $original_post_id != $post->ID) {
$original_post = get_post($original_post_id);
if ($original_post) {
$pattern = '/^' . preg_quote($original_post->post_name, '/') . '(-\d+)?$/';
if (preg_match($pattern, $post->post_name)) {
// Slug is a duplicate or a variation of the original.
// Update the post with an empty post_name to trigger auto-generation.
wp_update_post(array(
'ID' => $post->ID,
'post_name' => ''
));
$count_updated++;
}
}
}
}
}
wp_admin_notice("Process completed. $count_updated translated slugs were reset and regenerated from their titles.", array(
'type' => 'success'
));
}
if (isset($_GET['fix_slugs']) && $_GET['fix_slugs'] == 'true') {
add_action('init', 'wpml_fix_translated_slugs_with_suffixes');
}
Please add the script to the functions.php file of your active theme. After that, execute it once using the following URL: If you have any questions or need assistance while applying the script, feel free to let us know. Best regards, |

