This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to delete translations for languages that have been removed in WPML's language settings, but the system hangs with a rotating circle and the translations remain undeleted after refreshing the page.
Solution:
We recommend deleting all taxonomies and translated menus first, and then running the cleanup through WPML -> Languages. If this does not resolve the issue, you could use WP-CLI to delete the terms manually. Here is a script that might help:
#!/bin/bash<br /><br /># Function to get term IDs by taxonomy and language<br />get_term_ids_by_language() {<br />local taxonomy=$1<br />local language_code=$2<br />wp db query "<br />SELECT t.term_id<br />FROM $(wp db prefix)terms AS t<br />JOIN $(wp db prefix)term_taxonomy AS tt ON t.term_id = tt.term_id<br />JOIN $(wp db prefix)icl_translations AS icl ON tt.term_taxonomy_id = icl.element_id<br />WHERE tt.taxonomy = '${taxonomy}' AND icl.language_code = '${language_code}'<br />" --skip-column-names<br />}<br /><br /># Define the languages and taxonomies you want to delete<br />languages=("en" "fr" "es") # Replace with your language codes<br />taxonomies=("product_cat" "product_tag" "category" "post_tag" "nav_menu" "tax_translation_priority")<br /><br /># Loop through each language and taxonomy to delete terms<br />for lang in "${languages[@]}"; do<br />for tax in "${taxonomies[@]}"; do<br />term_ids=$(get_term_ids_by_language "$tax" "$lang")<br />if [ -n "$term_ids" ]; then<br />wp term delete "$tax" $term_ids<br />fi<br />done<br />done
If this solution does not apply to your case, or if it seems outdated, please check the related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If you still need assistance, we highly recommend opening 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.
This topic contains 10 replies, has 2 voices.
Last updated by 8 months, 4 weeks ago.
Assisted by: Bruno Kos.