Skip Navigation

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

Problem:
When WPML is active, importing products using a CSV in WooCommerce results in products being set to post status 'draft' even though the 'published' column is set to 1. Without WPML, products are imported with post status 'publish' as expected.
Solution:
If you're experiencing this issue, it's important to complete the linking of languages with WPML Export Import after the initial product import. This step ensures that the products are set to the correct post_status as assigned in your CSV file. Initially, products may appear as drafts, but this is temporary and resolves once languages are fully linked. For further guidance, you might find it helpful to review a similar case discussed in our forum: https://wpml.org/forums/topic/all-import-and-translated-products-goes-to-draft/

Please note that this solution might be outdated or not applicable to your specific case. 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 the issue persists, please open a new support ticket for personalized assistance.

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.

Tagged: 

This topic contains 2 replies, has 1 voice.

Last updated by Vincent Dagenais 5 months, 4 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
December 5, 2024 at 8:36 pm #16483717

Vincent Dagenais

Background of the issue:
Hi. When WPML is active, importing products using a CSV in woocommerce fallsback to post status 'draft' even though the 'published' column is set to 1 and is matched on import to the matching column.

Without WPML active, I can set the published column in the csv to 1 and have my products being imported as post_status publish as expected.

Where I added var_dump logs to prove that Woocommerce correctly sets the post status to 'publish' and confirm Woocommerce is not the issue : (Between lines 874 and 893). $data['published] returns 1 and $data['status'] returns 'publish'
hidden link

Their documentation on the csv structure expected : hidden link

Thanks

Symptoms:
WooCommerce imports products as post_status draft instead of publish when WPML is active, despite the CSV column 'published' being set to 1.

Questions:
Why does the product status change to draft when WPML is active?
How can I ensure products are imported as published with WPML active?

December 6, 2024 at 6:24 am #16484615

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There!
I hope you're doing well.

Before this thread is assigned to my colleague, I’d like to provide some initial guidance and possible solutions.

While reviewing similar reports, I came across this one: https://wpml.org/forums/topic/all-import-and-translated-products-goes-to-draft/.

The issue described in that ticket closely resembles the one you’ve reported. Could you please try the solution outlined in that ticket and see if it resolves your issue?

Please feel free to let us know if you need further assistance in this matter. We'll be happy to help.

Best regards,
Prosenjit

December 6, 2024 at 3:31 pm #16486681

Vincent Dagenais

Hello there,

After better analysis, I've realized that even though after the import all products are drafts, when I've finalized running WPML Export Import, all WPML columns (_wpml_import_translation_group _wpml_import_language_code _wpml_import_source_language_code) are properly matched and published:1 / published:-1 columns are affected accordingly.

So, to anyone meeting this issue, the solution is to finalize linking languages with WPML Export Import and only then will your products be set to the correct post_status as assigned in your CSV file initially.

I was just surprised to see all products as drafts after the import. But it's temporary before languages are completed linked.

Thanks, this issue is resolved you can close this ticket.
Regards,