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.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
-
6:00 – 12:00
8:00 – 12:00
6:00 – 12:00
8:00 – 12:00
6:00 – 12:00
-
-
13:00 – 15:00
13:00 – 17:00
13:00 – 15:00
13:00 – 17:00
13:00 – 15:00
-
Fuseau horaire du support : America/Lima (GMT-05:00)
Les langues: Anglais (English )Français (Français )
Fuseau horaire: America/Lima (GMT-05:00)
Hello,
Welcome to the WPML support forum. I would first start by saying that deleting products directly from the database can be messy because you have to delete information stored in different tables: the post itself, all post metas, the translation tables, plus any other things that third party plugins could add. So, you may have a lot of "leftovers/orphans" to clean up.
The easiest way would be to use the WordPress interface:
- Go to "Products" in your dashboard,
- Switch to the targeted language and them select all products and delete them
- Note that you can use the "Screen options" at the top of your screen to increase the number of products per page from 20 to 100 (or more if you have a good server)
Else you could write a PHP code that use "wp_delete_post" because that will delete not only the posts but all the post metas (and I think it will also delete the entries in the translation tables). Custom code is out of the scope of our support and I would recommend to make a full backup of your database first.
We have a Woocommerce store and we use WPML as our translation plugin. we added 14 languages. we notice that the website is getting slower and also our server is showing that wpml queries take long to execute.
now what we want to do is reduce the languages form 14 to 7 languages. the number of products is big so we can't delete them 50 by 50 we need to remove the at once, and the better way to do it is with SQL. we need to remove them completly from the database aswell.
so my question is; can you provide us with SQL requete that will remove all the content of a language (AR for example) from the database.
Les langues: Anglais (English )Français (Français )
Fuseau horaire: America/Lima (GMT-05:00)
Hi,
Thanks for the explanation. In that case I have an easier way to do it.
- Go to "WPML > Languages > Site Languages" and click on "Add/Remove languages"
- Remove the languages you desire
- A new table with all the content from those removed languages will appear and ask you if you want to delete them from your database.
See screenshot.
Le sujet « [Fermé] remove all product with sql » est fermé aux nouvelles réponses.
Gérer le consentement aux cookies
Nous utilisons des cookies pour optimiser notre site web et nos services. Votre consentement nous permet de traiter des données telles que le comportement de navigation. L'absence de consentement peut affecter certaines fonctionnalités.
Fonctionnel
Toujours activé
Nécessaire au bon fonctionnement et à la communication de notre site web.
Préférences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistiques
Nous les utilisons pour analyser les statistiques de notre site. Les informations collectées sont totalement anonymes. Le stockage ou l'accès technique qui est utilisé exclusivement à des fins statistiques anonymes. Sans citation à comparaître, la conformité volontaire de la part de votre fournisseur d'accès Internet ou d'autres dossiers d'un tiers, les informations stockées ou récupérées à cette fin ne peuvent généralement pas être utilisées pour vous identifier.
Marketing
Ces cookies suivent votre navigation pour vous proposer des publicités pertinentes pour vous.