Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
WP All Import plugin via WP-CLI and profiles
Solution:
There is no WP-CLI support here yet, especially not in combination with all import.

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 6 replies, has 2 voices.

Last updated by Fabrizio 1 year, 11 months ago.

Assisted by: Bruno Kos.

Author Posts
May 19, 2023 at 5:08 pm #13680897

Fabrizio

Hello,
I would like to use WP-CLI to run "WP All Import" plugin profiles in order to manage a WooCommerce catalog.
If I try to run one of them via WP-CLI, it always considers the main language while there could be problems with the secondary languages.
Is it possible to run profiles via WP-CLI in these other languages without having risks to break somenthing in the site?

May 22, 2023 at 9:20 am #13687631

Bruno Kos
WPML Supporter since 12/2018

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

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

Hi,

Thank you for contacting WPML support!

If I'm not mistaken this would not be WPML question but instead a question of WP All Import's WP-CLI integration whether it can accept language parameters, correct?

hidden link

Can you tell me how these imports look like, what are your all import calls that are currently running in the original language and how do you expect them to look like if the call was done in another language?

We do not have this supported but I also don't see that such functionality was requested by anyone else in our forums yet, so even if I would submit this as a feature request I don't think it will gain traction until we have more reports.

Regards,
Bruno Kos

May 22, 2023 at 12:56 pm #13690163

Fabrizio

Hello Bruno,
thanks for you reply.
I've already asked the same question to WP All Import support team and they replied they don't provide support to multilingual imports, as the WPML All Import Add-On is developed and supported directly by your team. So they suggested writing to you.

Honestly I don't know which one should provide this feature but I would agree more with them because the multilingual support is a feature introduced by your plugin.

Anyway, here's the situation: I've created in backend two profiles, one in primary language and one in the secondary one. This last one is related to the first one with the standard settings you provide and everything works fine if I run the two import profiles in backend.
However, if I try to run them via WP-CLI, some problems may araise with posts and terms that could be set in the primary language instead of the one that belongs to the current profile. I think it's necessary to force somehow the language that profile must use.

WP All Import, as you can read also in the link you pasted, provides this command to run profiles via WP-CLI:

wp all-import run <PROFILE_ID>

There seems to be no option to force the language.

What do you suggest to do to handle this issue?

Kind regards

May 22, 2023 at 2:10 pm #13691031

Bruno Kos
WPML Supporter since 12/2018

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

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

Hi,

If you run this through wp-cli and each profile has its language set, would it not start import according to language set for the profile only?

e.g:
wp all-import run <PROFILE_ID_english>
wp all-import run <PROFILE_ID_english>

So a language parameter would not be needed?

Anyway did you try all this already, but after the import it gives you wrong results?

Regards,
Bruno Kos

May 22, 2023 at 3:44 pm #13692453

Fabrizio

I think the main problem stands in the chained execution of profiles.
If I run

wp all-import run <PROFILE_ID_lang1>,<PROFILE_ID_lang2>

the import always considers the language of the first executed profile so the next profile would not work correctly because they're going to use the wrong language.

Regards.

May 23, 2023 at 11:45 am #13698371

Bruno Kos
WPML Supporter since 12/2018

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

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

Hi,

I'm afraid there is no such functionality. There is no WP-CLI support here yet, especially not in combination with all import.

Regards,
Bruno Kos

May 26, 2023 at 6:59 am #13720003

Fabrizio

Thanks for the support.
Hope you will find soon a way to fix this issue.