Skip Navigation

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

Problem:
If you're experiencing issues where translated products are moved to draft status after importing them with All Import, while the main product remains published, this might be due to the settings in WPML. Specifically, this occurs when the 'Translated documents options' in WPML Settings is set to 'Publish the translated post when original is also published (default)'. This setting causes translations to mirror the status of the original post.

Solution:
1. Ensure that you import the default language of your site first. Automatic translation in WPML only functions from the site's default language to other languages.
2. If you need to handle multiple languages, consider using the WPML All Import plugin for importing and managing translations effectively. You can find the guide here: Import in one language & translate with WPML
3. For a more updated solution, use the WPML Export and Import plugin. Detailed guidance is available here: WPML Export and Import
4. Check if the necessary bridge plugins are installed on your site as they are essential for the imports to work correctly.

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.

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.

Our next available supporter will start replying to tickets in about 8.19 hours from now. Thank you for your understanding.

This topic contains 14 replies, has 2 voices.

Last updated by Itamar 2 months, 3 weeks ago.

Assisted by: Itamar.

Author Posts
July 3, 2024 at 1:16 pm #15884634

taimarP

Background of the issue:
I have an XML import with All Import. I have set the default language as Estonia on All Import. I am trying to import products, and I have translated products.

Symptoms:
If I have a translated product, then after import the translated product goes to draft, while the main product is published.

Questions:
Is it an issue with All Import or WPML?

July 3, 2024 at 1:22 pm #15884687

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Were the translated products also imported into the site?

Regards,
Itamar.

July 3, 2024 at 1:48 pm #15885107

taimarP

no, I'm using automated translation,
I just tested with one product, I made manually translation in one language, run import again and tranalated product is in draft

July 4, 2024 at 7:32 am #15889773

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

This must be because of your settings in WPML -> Settings -> Automatic Translation. Under "What should happen with your automatically translated content" you probably have this setting "Let me review it before it gets published".

If you want automatic translations to be published right away, you need to select one of the other options:

- Publish right away but mark as not reviewed so I can take a look later

- Publish right away without reviewing

Please check and confirm.

You can also publish everything in bulk in WPML -> Translations.

Regards,
Itamar.

July 4, 2024 at 8:15 am #15890200

taimarP

Hi

I already have it is "Publish right away without reviewing" but still the same.
I tried to turn off the automatic translation and manually translated one language in one product, run the import again and main lang is publish but other languages (not only that last translation, but also previously translated product ) is moved to draft.

I checked all import log but there is nothing about translated products.

I had another issue which is also might be related to this. New products missing wpml entries in wp_icl_translations table and due to that product are not visible inf ront and not even in admin, If look in wp_posts table then i see them there. Then i found suggestion to add entries to this table and then they works ok. On that i made snippet on hook pmxi_saved_post which saves entries after all import saves the product.

SQL to find missing entries is: SELECT * FROM `s2hr_posts` as p
left join s2hr_icl_translations as t on t.element_id=p.ID
WHERE p.`post_type` LIKE 'product' and t.element_id is null;

July 4, 2024 at 3:26 pm #15893072

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

As a workaround, you can bulk edit the products set to draft and change them to published. Please see the attached screenshot.

If you need further help, please give me access to your site and explain how to replicate the problem.

If you need further help with this, please share the access details to your site with me.
I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

July 8, 2024 at 7:28 am #15910504

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, and thanks for the access details.

When I go to All Import -> Manage Imports, I see one import called "products.xml".
Is this the import in question?
I ask this because I also see the following warning under this import:

Warning: Any Products not in your import file will be marked as draft, even those not created by this import.

Please see the attached screenshot products-xml.jpg.
I assume this is because of certain settings. While waiting for your reply, I'm also consulting our second-tier supporters.

Regards,
Itamar.

products-xml.jpg
July 8, 2024 at 7:41 am #15910583

taimarP

This is correct one.
Does that mean if i have translated products then i have to add separate import for those products for each language, seems overkill.

So if the main lang is EST and import runs to the EST lang by default, then all translated products will be in draft as import cannot find them in XML.

But it should find them as the unique field ARTNO is the same in all languages.

Screenshot: import settings regarding moving product to Draft (Mustand)

wpml6.jpg
July 8, 2024 at 7:48 am #15910693

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

You wrote/asked: "Does that mean if i have translated products then i have to add separate import for those products for each language, seems overkill."

The answer is yes. You must create a separate import file for each language. Please review our WP All Import guide here.

https://wpml.org/documentation/related-projects/legacy-wpml-all-import/importing-multiple-languages-with-wp-all-import-and-wpml/

I'm sorry for not sharing this guide earlier in our discussion. I was sure you were familiar with it and the correct process.

Regards,
Itamar.

July 8, 2024 at 8:03 am #15910770

taimarP

ooouh, thats not nice at all.

Not all products are translated to each language, so and if they not translated then product is visible in all languages, that is good. If there is translation made to the product, either manually or automatic, then the product will be dropped to draft (translated products)?

We have dynamic XML which comes from ERP system and to use wpml automatic translation seemed nice feature to use for product translations.

I guess for us is either we don't translate products at all or i run SQL script after each import to change translated product status.

In WPML settings i cannot choose to import to all languages at once?
I have to make 4 different imports additionally even the data is almost the same.

July 9, 2024 at 7:18 am #15918433

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

You asked: "In WPML settings i cannot choose to import to all languages at once?
I have to make 4 different imports additionally even the data is almost the same."

If the data is the same (products are the same and not actually translated) you can duplicate the products to the other languages rather than import them. You can learn how to do it here.

https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#duplicating-content

I'm also adding our second-tier supporter reply. It is regarding the warning that shows on the import:

Warning: Any Products not in your import file will be marked as draft, even those not created by this import.

Our second-tier supporter has found that this warning comes from the WP All Import Pro plugin. It is in plugins/wp-all-import-pro/helpers/functions.php:

	            if ($options['delete_missing_logic'] == 'all' && $options['delete_missing_action'] == 'keep' && !empty($options['is_change_post_status_of_removed'])) {
		            if( !empty($options['is_send_removed_to_trash']) ) {
			            $notice = sprintf( __( '<span class="important-warning">Warning</span>: Any %s not in your import file will be sent to the trash, even those not created by this import.' ), $custom_type->labels->name);
		            }else{
			            $notice = sprintf( __( '<span class="important-warning">Warning</span>: Any %s not in your import file will be marked as %s, even those not created by this import.' ), $custom_type->labels->name, $options['status_of_removed'] );
		            }
	            }

I hope you can deduct something from this warning regarding your settings. Our point is that the products are being set to draft because of WP All Import settings and not because of our WPML All Import. So you must check your settings. With those settings (that trigger the warning), we assume this would have been the case even without WPML.

Regards,
Itamar.

July 10, 2024 at 1:31 pm #15928270

taimarP

For duplicated products i cannot translate even some fields like title and description?

I still need automatic translation for products, with small interaction in shop side. Products are created in CRM program, XML import imports them into main language. Then WPML automatic translation translates, so far all good. but next import turns translated products to draft.

regarding the script, either way it shows the notice, just the message is little bit different.

July 11, 2024 at 1:30 pm #15935373

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

To convert a duplicate to a translation, click the Translate independently button. This stops the post from automatically syncing with the default language content. You can read about it in the same guide I sent you here.

https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#how-to-convert-a-translation-into-a-duplicate

You wrote: "regarding the script, either way it shows the notice, just the message is little bit different."

What do you mean by either way?

If this was unclear, I'm sorry. We didn't ask you to add this code anywhere. We pointed out that the message is coming from the WP All Import plugin and is shown because of the settings you set, not because of our plugins. It is most likely that you will also get this problem (if you keep the same settings) when WPML and its add-ons are deactivated. Can you please check this?

Regards,
Itamar.

July 12, 2024 at 12:41 pm #15942548

taimarP

by the All import settings, our aim is to remove products which is not in the XML, either trash or draft. This is the All import settings what we have set and that shows this error. thats ok. If we disable WPML plugins then we only have one scope (one language) and everything works as it supposed.

Problem was that if I use one language import then other language products will be moved to the draft. Based on CRM there is no easy way to other language XML, as we wanted to use WPML automatic translation. Then there will be lots other products which to translate (does that mean if i import also Finnish language products separately by xml then i have to translate Est product to fin and Fin product to EST even if the are linked by wpml?)?

Main aim was that to import one language xml (main language) and translated product uses main product status, not separately. I guess it is still WPML all import add-in which behaves that way.

July 14, 2024 at 4:19 pm #15950484

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

You wrote: "Problem was that if I use one language import then other language products will be moved to the draft."

This might be because of the setting you have in WPML → Settings → Translated documents options → When you receive completed translations. According to the debug information, you have it set to "Publish the translated post when original is also published (default)". This means that if the original is set to Dfart, the translation will also get set to draft.

You also wrote: "Based on CRM there is no easy way to other language XML, as we wanted to use WPML automatic translation."

A. You can edit the XML file generated from the CRM and separate it into different languages. I'm sorry, but there is no other way to make it easier.

B. You must first import the default language of the site.

C. Automatic translation only works from the site's default language to other languages.

You can only import the site's default language without importing the translations. Please read about it here.

https://wpml.org/documentation/related-projects/legacy-wpml-all-import/#import-in-one-language-translate-with-wpml

You asked: "does that mean if i import also Finnish language products separately by xml then i have to translate Est product to fin and Fin product to EST even if the are linked by wpml?"

If you do it correctly according to our guide, then the secondary language (Fin in your case) should be connected to the default language (EST in your case). The default language must be imported first. We have a legacy plugin called WPML All Import that you must use when working with WPML and WP All Import. This is the guide when you want to import

https://wpml.org/documentation/related-projects/legacy-wpml-all-import/importing-multiple-languages-with-wp-all-import-and-wpml/

We now have a newer plugin we urge our users to use when working with WP All Import. It is called WPML Export and Import. Please read its guide here.

https://wpml.org/documentation/related-projects/wpml-export-and-import/

According to your site's debug information, none of the above bridge plugins are installed on your site. I'm sorry if it was unclear until now; you should use one of the bridge plugins for the imports to work.

I hope this makes things clear.

Regards,
Itamar.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.