[Resolved] Export product attributes values and its translations
This thread is resolved. Here is a description of the problem and solution.
Problem: You need to export product attributes and their translations into a single table using SQL or the WP ALL EXPORT plugin, but currently, they export as separate rows. Solution: We tested the WP All Export Pro and WP All Export - WooCommerce Export Add-On Pro plugins and found that each translation has a separate Term ID, causing each term to start on a new line in the export file. To organize the data in a single table, you can add the custom fields _wpml_import_language_code and _wpml_import_translation_group. After adding these fields, sort your spreadsheet based on _wpml_import_translation_group to group the English term with its translations. Additionally, consider using AI to reorganize the spreadsheet if necessary, as it might be simpler than custom coding.
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 you still need assistance, please open 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.
Background of the issue:
I want to export product attributes data and its translations into one table using SQL or the WP ALL EXPORT plugin. I can currently export them as separate rows, but I need them all translated in one table. The website works fine, and every product appears online correctly with translations.
Symptoms:
I am unable to export product attributes and their translations into a single table.
Questions:
How can I export product attributes and their translations into one table using SQL or WP ALL EXPORT?
What steps should I follow to achieve a single table export of translated product attributes?
Welcome to the WPML support forum. Before passing this thread to my colleague, I would like to share some suggestions and possible solutions for the issues you mentioned.
Sorry for the late response because of the holidays and the high support load. It is not normal here. Thank you for your kind understanding.
Yes, I went through the documentation, but i couldn't find anything related with my specific issue. As I mentioned in the initial message, I don't want to export product info, I just need for internal reasons export all data regarding values of attributes and its translations.
I attached a screenshot to show what data I am speaking about.
I want to admit that translation works perfectly on the website. I am just not able to get this data to file.
Could you please clarify what you mean by "export into one table"? Is it possible for you to export just product attributes data into a single table without WPML? Can you provide me with examples?
Well, while using WP ALL Export I can get for example 1 attribute with all the records in all languages. Here you can see what receive: hidden link
I would like to get it in the way I can see the original term in polish, then translations in other columns. PL | EN | DE | FR.
I am wondering if it is possible? As far as I assume it is not possible, but maybe there is some sort of way?
How it is possible then, that in the product page, this attribute value show correctly translated in every language? Is this linked with term ID or what?
Unfortunately, implementing such a scenario requires custom coding, which is beyond the scope of the support provided here.
WPML stores language information in separate tables. You can view these tables using a database editor like phpMyAdmin. Here, you can observe how the data is organized: https://wpml.org/documentation/support/wpml-tables/
Hello Andrey, I am fine with custom coding, and don't want you to code anything. You will help me if you can say what values I can use, or what records your system is using to match the values with its translations. It will help me a lot as I tried many different approaches and all of this was mess. I am wondering if it is possible to extract it in the way my company wants it.
I have tested the WP All Export Pro and WP All Export - WooCommerce Export Add-On Pro plugins. Unfortunately, I could not find a way to export the data in the desired format. Each translation has a separate Term ID, which means that each term starts on a new line in the export file.
However, you can add the custom fields _wpml_import_language_code and _wpml_import_translation_group. By further sorting your spreadsheet based on _wpml_import_translation_group, you can organize each group to display the English term and its translations in the group.
You can even try to use AI to reorganize the spreadsheet if needed. I believe it would be easier than custom coding.
Andrey! Thank you so much for the support. Your explanation helped me so much to achieve what I was hoping for. Based on your information, I was able to prepare proper SQL for my database and organize the file afterward based on _translation_group. I am really grateful and wish you all the best!