Title: Export not including data
Last modified: November 10, 2021

---

# Export not including data

 *  Resolved [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/)
 * Hello, we are exporting products with the built-in WooCommerce exporter and importing
   them on a new website but information on custom tabs is empty on products that
   had tabs defined.
 * All products imported have a new ID defined by WordPress but I don’t think this
   is the issue…
 * Any ideas on what is causing this? We need to export products in a special way
   or something I’m missing here?
 * Thank you.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/export-not-including-data/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/export-not-including-data/page/2/?output_format=md)

 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15054031)
 * I have created a new CSV with only one variable product, and I can see the column`
   Meta: yikes_woo_products_tabs` with the custom product tabs data.
 * Please see: [https://prnt.sc/1z0badc](https://prnt.sc/1z0badc)
 * When importing on WooCommerce I select to import that column as meta (default).
   
   But when the import finishes, there is no custom tabs in frontend or backend.
   The custom product tabs tab, are empty.
 * Please see: [https://prnt.sc/1z0azvd](https://prnt.sc/1z0azvd)
 * Custom Product Tabs para WooCommerce v1.7.7
    WooCommerce v5.8.0
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15054100)
 * Here you have data from exported CSV and from the import on the database:
 * **Data exported on CSV:**
 *     ```
       a:5:{i:0;a:3:{s:5:"title";s:16:"MANZANA & CANELA";s:2:"id";s:14:"manzana-canela";s:7:"content";s:810:"<h4>INGREDIENTES</h4>
       Pasta de higo, pasta de dátil, semillas de calabazas*, manzana deshidratada troceada*, aceite de girasol*, pasas sultanas* (pasas> 99,5%, aceite de girasol ecológico <0.7%), aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitamínico, amilopectina, canela en polvo*, aroma natural de manzana. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.
   
       [caption id="attachment_10252" align="alignnone" width="1226"]<img class="size-full wp-image-10252" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-manzana-canela.png" alt="Información Nutricional Race Day Bar - Manzana & Canela" width="1226" height="980" /> Información Nutricional Race Day Bar - Manzana & Canela[/caption]";}i:1;a:3:{s:5:"title";s:17:"BANANA & JENGIBRE";s:2:"id";s:15:"banana-jengibre";s:7:"content";s:724:"<h4>INGREDIENTES</h4>
       Pasta de higo, pasta de dátil, banana flakes, aceite de girasol*, amilopectina, aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), semillas de calabaza*, complejo vitamínico, jengibre en polvo*, aroma natural de plátano. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.
   
       [caption id="attachment_10251" align="alignnone" width="1228"]<img class="size-full wp-image-10251" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-banana-jengibre.png" alt="Información Nutricional Race Day Bar - Banana & Jengibre" width="1228" height="986" /> Información Nutricional Race Day Bar - Banana & Jengibre[/caption]";}i:2;a:3:{s:5:"title";s:15:"CHOCOLATE NEGRO";s:2:"id";s:15:"chocolate-negro";s:7:"content";s:1013:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <p style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil, cacao en polvo desgrasado natural, semillas de calabaza*, aceite de girasol*, pasas sultanas* (pasas > 99.5%, aceite de girasol ecológico < 0.7%)*, pepitas de chocolate* (pasta de cacao > 50%, azúcar de caña ecológica, manteca de cacao, emulsificante: lecitina de soja)*, aroma natural de chocolate, amilopectina, aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitamínico. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</p>
   
       [caption id="attachment_10250" align="alignnone" width="1232"]<img class="size-full wp-image-10250" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-chocolate-negro.png" alt="Información Nutricional Race Day Bar - Chocolate Negro" width="1232" height="986" /> Información Nutricional Race Day Bar - Chocolate Negro[/caption]";}i:3;a:3:{s:5:"title";s:24:"CHOCOLATE BLANCO Y FRESA";s:2:"id";s:24:"chocolate-blanco-y-fresa";s:7:"content";s:766:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <span style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil*, fresa en polvo, semillas de calabaza*, pepitas de chocolate blanco (leche, soja), aceite de girasol*, complejo vitamínico, amilopectina de arroz, aroma natural de fresa. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</span>
   
       [caption id="attachment_16031" align="alignnone" width="500"]<img class="wp-image-16031 " src="https://findyoureverest.es/wp-content/uploads/2020/03/valor-nutricional-race-day-bar-chocolate-blanco-fresa.png" alt="Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa" width="500" height="411" /> Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa[/caption]";}i:4;a:3:{s:5:"title";s:6:"LIMÓN";s:2:"id";s:5:"limon";s:7:"content";s:700:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <span style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil*, pepitas de chocolate negro*(soja), semillas de calabaza*, limón en flakes, aceite de girasol*, limón en polvo, complejo vitamínico, amilopectina de arroz. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</span>
   
       [caption id="attachment_16032" align="alignnone" width="500"]<img class="wp-image-16032 " src="https://findyoureverest.es/wp-content/uploads/2020/03/valor-nutricional-race-day-bar-limon.png" alt="Valor Nutricional Race Day Bar - Limón" width="500" height="413" /> Valor Nutricional Race Day Bar - Limón[/caption]";}}
       ```
   
 * **Data imported on the database:**
 *     ```
       s:4503:"a:5:{i:0;a:3:{s:5:"title";s:16:"MANZANA & CANELA";s:2:"id";s:14:"manzana-canela";s:7:"content";s:810:"<h4>INGREDIENTES</h4>
       Pasta de higo, pasta de dátil, semillas de calabazas*, manzana deshidratada troceada*, aceite de girasol*, pasas sultanas* (pasas> 99,5%, aceite de girasol ecológico <0.7%), aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitamínico, amilopectina, canela en polvo*, aroma natural de manzana. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.
   
       [caption id="attachment_10252" align="alignnone" width="1226"]<img class="size-full wp-image-10252" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-manzana-canela.png" alt="Información Nutricional Race Day Bar - Manzana & Canela" width="1226" height="980" /> Información Nutricional Race Day Bar - Manzana & Canela[/caption]";}i:1;a:3:{s:5:"title";s:17:"BANANA & JENGIBRE";s:2:"id";s:15:"banana-jengibre";s:7:"content";s:724:"<h4>INGREDIENTES</h4>
       Pasta de higo, pasta de dátil, banana flakes, aceite de girasol*, amilopectina, aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), semillas de calabaza*, complejo vitamínico, jengibre en polvo*, aroma natural de plátano. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.
   
       [caption id="attachment_10251" align="alignnone" width="1228"]<img class="size-full wp-image-10251" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-banana-jengibre.png" alt="Información Nutricional Race Day Bar - Banana & Jengibre" width="1228" height="986" /> Información Nutricional Race Day Bar - Banana & Jengibre[/caption]";}i:2;a:3:{s:5:"title";s:15:"CHOCOLATE NEGRO";s:2:"id";s:15:"chocolate-negro";s:7:"content";s:1013:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <p style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil, cacao en polvo desgrasado natural, semillas de calabaza*, aceite de girasol*, pasas sultanas* (pasas > 99.5%, aceite de girasol ecológico < 0.7%)*, pepitas de chocolate* (pasta de cacao > 50%, azúcar de caña ecológica, manteca de cacao, emulsificante: lecitina de soja)*, aroma natural de chocolate, amilopectina, aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitamínico. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</p>
   
       [caption id="attachment_10250" align="alignnone" width="1232"]<img class="size-full wp-image-10250" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-chocolate-negro.png" alt="Información Nutricional Race Day Bar - Chocolate Negro" width="1232" height="986" /> Información Nutricional Race Day Bar - Chocolate Negro[/caption]";}i:3;a:3:{s:5:"title";s:24:"CHOCOLATE BLANCO Y FRESA";s:2:"id";s:24:"chocolate-blanco-y-fresa";s:7:"content";s:766:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <span style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil*, fresa en polvo, semillas de calabaza*, pepitas de chocolate blanco (leche, soja), aceite de girasol*, complejo vitamínico, amilopectina de arroz, aroma natural de fresa. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</span>
   
       [caption id="attachment_16031" align="alignnone" width="500"]<img class="wp-image-16031 " src="https://findyoureverest.es/wp-content/uploads/2020/03/valor-nutricional-race-day-bar-chocolate-blanco-fresa.png" alt="Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa" width="500" height="411" /> Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa[/caption]";}i:4;a:3:{s:5:"title";s:6:"LIMÓN";s:2:"id";s:5:"limon";s:7:"content";s:700:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <span style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil*, pepitas de chocolate negro*(soja), semillas de calabaza*, limón en flakes, aceite de girasol*, limón en polvo, complejo vitamínico, amilopectina de arroz. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</span>
   
       [caption id="attachment_16032" align="alignnone" width="500"]<img class="wp-image-16032 " src="https://findyoureverest.es/wp-content/uploads/2020/03/valor-nutricional-race-day-bar-limon.png" alt="Valor Nutricional Race Day Bar - Limón" width="500" height="413" /> Valor Nutricional Race Day Bar - Limón[/caption]";}}";
       ```
   
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15054129)
 * Just checked data from import on database trough [https://freeonlinetools24.com/unserialize](https://freeonlinetools24.com/unserialize)
   but got a message of `Unable to process your request, please provide valid serialized
   data.`
 * So how this can be possible? As we are only exporting and importing data without
   any modification?
 * Thank you
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15054201)
 * I have compared the value of the column on the original database and has not 
   the beginning `s:4503:"` that is present on the new imported database.
 * So seems that WooCommerce is adding that on importing. Any ideas on what can 
   be causing this?
 *  [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * (@jpowersdev)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15054753)
 * Hi [@danidub](https://wordpress.org/support/users/danidub/),
 * So in the example you sent, your site is treating the entire block of serialized
   data as a string because it’s not properly formatted data. It seems like the 
   problem here is the export process, not the import process.
 * If you look in the database on the original site and check the meta for the example
   you are using, does the meta value line up with what you see in the export spreadsheet?
   If not, does running that value through the serialized data tool display any 
   errors?
 * Let me know what you find,
    Jon
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15054884)
 * Hey [@jpowersdev](https://wordpress.org/support/users/jpowersdev/), thank you
   for your answer.
 * The data that is in the original DB (that is working fine) is not unserializing
   with the tool ([https://freeonlinetools24.com/unserialize](https://freeonlinetools24.com/unserialize)).
   An error is shown `Unable to process your request, please provide valid serialized
   data.`
 * I find it strange that even is not unserializing, is working fine on the original
   website.
 * Also, the data that is present on the original database is the same as the on
   present on the CSV after exporting. I have compared both strings with an online
   tool.
 * The data is:
 *     ```
       a:5:{i:0;a:3:{s:5:"title";s:16:"MANZANA & CANELA";s:2:"id";s:14:"manzana-canela";s:7:"content";s:810:"<h4>INGREDIENTES</h4>
       Pasta de higo, pasta de dátil, semillas de calabazas*, manzana deshidratada troceada*, aceite de girasol*, pasas sultanas* (pasas> 99,5%, aceite de girasol ecológico <0.7%), aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitamínico, amilopectina, canela en polvo*, aroma natural de manzana. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.
   
       [caption id="attachment_10252" align="alignnone" width="1226"]<img class="size-full wp-image-10252" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-manzana-canela.png" alt="Información Nutricional Race Day Bar - Manzana & Canela" width="1226" height="980" /> Información Nutricional Race Day Bar - Manzana & Canela[/caption]";}i:1;a:3:{s:5:"title";s:17:"BANANA & JENGIBRE";s:2:"id";s:15:"banana-jengibre";s:7:"content";s:724:"<h4>INGREDIENTES</h4>
       Pasta de higo, pasta de dátil, banana flakes, aceite de girasol*, amilopectina, aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), semillas de calabaza*, complejo vitamínico, jengibre en polvo*, aroma natural de plátano. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.
   
       [caption id="attachment_10251" align="alignnone" width="1228"]<img class="size-full wp-image-10251" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-banana-jengibre.png" alt="Información Nutricional Race Day Bar - Banana & Jengibre" width="1228" height="986" /> Información Nutricional Race Day Bar - Banana & Jengibre[/caption]";}i:2;a:3:{s:5:"title";s:15:"CHOCOLATE NEGRO";s:2:"id";s:15:"chocolate-negro";s:7:"content";s:1013:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <p style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil, cacao en polvo desgrasado natural, semillas de calabaza*, aceite de girasol*, pasas sultanas* (pasas > 99.5%, aceite de girasol ecológico < 0.7%)*, pepitas de chocolate* (pasta de cacao > 50%, azúcar de caña ecológica, manteca de cacao, emulsificante: lecitina de soja)*, aroma natural de chocolate, amilopectina, aminoácidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitamínico. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</p>
   
       [caption id="attachment_10250" align="alignnone" width="1232"]<img class="size-full wp-image-10250" src="https://findyoureverest.es/wp-content/uploads/2020/03/informacion-nutricional-race-day-bar-chocolate-negro.png" alt="Información Nutricional Race Day Bar - Chocolate Negro" width="1232" height="986" /> Información Nutricional Race Day Bar - Chocolate Negro[/caption]";}i:3;a:3:{s:5:"title";s:24:"CHOCOLATE BLANCO Y FRESA";s:2:"id";s:24:"chocolate-blanco-y-fresa";s:7:"content";s:766:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <span style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil*, fresa en polvo, semillas de calabaza*, pepitas de chocolate blanco (leche, soja), aceite de girasol*, complejo vitamínico, amilopectina de arroz, aroma natural de fresa. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</span>
   
       [caption id="attachment_16031" align="alignnone" width="500"]<img class="wp-image-16031 " src="https://findyoureverest.es/wp-content/uploads/2020/03/valor-nutricional-race-day-bar-chocolate-blanco-fresa.png" alt="Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa" width="500" height="411" /> Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa[/caption]";}i:4;a:3:{s:5:"title";s:6:"LIMÓN";s:2:"id";s:5:"limon";s:7:"content";s:700:"<h4 style="font-weight: 500; color: #000000;">INGREDIENTES</h4>
       <span style="font-weight: 500; color: #000000;">Pasta de higo, pasta de dátil*, pepitas de chocolate negro*(soja), semillas de calabaza*, limón en flakes, aceite de girasol*, limón en polvo, complejo vitamínico, amilopectina de arroz. *Proviene de agricultura ecológica. Sin ingredientes animales. No GMO.</span>
   
       [caption id="attachment_16032" align="alignnone" width="500"]<img class="wp-image-16032 " src="https://findyoureverest.es/wp-content/uploads/2020/03/valor-nutricional-race-day-bar-limon.png" alt="Valor Nutricional Race Day Bar - Limón" width="500" height="413" /> Valor Nutricional Race Day Bar - Limón[/caption]";}}
       ```
   
 *  [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * (@jpowersdev)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15055026)
 * Hi [@danidub](https://wordpress.org/support/users/danidub/),
 * I’m starting to think this is an encoding issue. The byte lengths of these strings
   in the serialized data are not what my computer or these external unserialize
   tools expect them to be, and that could be down to the encoding. If the old site
   is using a different encoding (ISO and not UTF-8), it would still work on the
   old server but not the new one.
 * For example, the content of the first tab is listed as having a byte length s:
   810, but on my local machine (where I am using UTF-8), the byte count is actually
   793. Making that change fixes that error, but then the next content block breaks.
 * If you have SSH access to the server, you can confirm this by running the `locale`
   command and checking the `LANG=` part at the beginning. If this is in fact your
   problem, you’re going to need to do some sort of conversion during the export
   process. Fortunately, woocomm has an easily extendable export tool. If you [look here](https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter#adding-custom-export-columns-developers),
   the `add_export_data` function provides an opportunity to modify the data before
   it prints to the spreadsheet.
 * You should just be able to modify the encoding of the string and return it. Knowing
   how to do that requires knowing the original encoding. Alternatively, you can
   use that function to convert the data from serialized data to something like 
   JSON, which does not store byte length. If you wind up going in that direction,
   [this knowledge base article](https://yikesplugins.com/knowledge-base/importing-custom-tabs-using-the-built-in-woocommerce-csv-importer/)
   will help you set up the import part of that process.
 * Good luck, and let me know how it goes.
    Jon
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15055395)
 * Hey [@jpowersdev](https://wordpress.org/support/users/jpowersdev/),
 * I have compared both tables on each database and they are both using `utf8mb4_unicode_ci`
   on the same hosting company.
 * As a second test I have placed the [code shared](https://yikesplugins.com/knowledge-base/importing-custom-tabs-using-the-built-in-woocommerce-csv-importer/)
   on the new website and try to import the data again with only one product. The
   same happens, no tabs or data on the “custom tabs”.
 * Checking the new database, the same, data is re-serialized with the string “s”
   at the beginning.
 * You can check the [file I’m trying to import here](https://findyoureverest.destaca.es/wc-product-export.csv)
 * Any further ideas?
    Thank you.
 *  [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * (@jpowersdev)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15055535)
 * Hi [@danidub](https://wordpress.org/support/users/danidub/),
 * This CSV looks like the same invalid data from before, with the incorrect byte
   lengths in the serialized data.
 * The code in the article I sent is only the import process, you’ll need to write
   some code that modifies the export to be JSON instead of serialized data. This
   link has examples for modifying the exported data – [https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter#adding-custom-export-columns-developers](https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter#adding-custom-export-columns-developers).
 * Let me know if that helps,
    Jon
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15055744)
 * Hello [@jpowersdev](https://wordpress.org/support/users/jpowersdev/),
 * I’m trying to add a custom import column to the CSV using the code below but 
   nothing gets exported on the column, can you please specify the name of the meta
   field?
 * I have tried with:
    `$value = $product->get_meta( 'yikes_custom_tabs', true, '
   edit' );` and `$value = $product->get_meta( 'yikes_woo_products_tabs', true, '
   edit' );`
 * I think I’m getting the meta field wrong.
 *     ```
       /**
        * Add the custom column to the exporter and the exporter column menu.
        *
        * @param array $columns
        * @return array $columns
        */
       function add_export_column( $columns ) {
   
       	// column slug => column name
       	$columns['custom_column'] = 'Custom Column';
   
       	return $columns;
       }
       add_filter( 'woocommerce_product_export_column_names', 'add_export_column' );
       add_filter( 'woocommerce_product_export_product_default_columns', 'add_export_column' );
   
       /**
        * Provide the data to be exported for one item in the column.
        *
        * @param mixed $value (default: '')
        * @param WC_Product $product
        * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
        */
       function add_export_data( $value, $product ) {
       	$value = $product->get_meta( 'yikes_custom_tabs', true, 'edit' );
       	return $value;
       }
       // Filter you want to hook into will be: 'woocommerce_product_export_product_column_{$column_slug}'.
       add_filter( 'woocommerce_product_export_product_column_custom_column', 'add_export_data', 10, 2 );
       ```
   
 *  [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * (@jpowersdev)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15056223)
 * Hi [@danidub](https://wordpress.org/support/users/danidub/),
 * The meta key is `yikes_woo_products_tabs`. You may want to update the column 
   and hook names. You can use the knowledge base article as a reference for the
   names.
 * Thanks,
    Jon
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15057725)
 * Hello [@jpowersdev](https://wordpress.org/support/users/jpowersdev/),
 * I have the export file with a new column called “Custom Tabs” with the data from`
   yikes_woo_products_tabs` encoded to JSON format.
 * The problem now is on importing, no meta is created. I’m following the [knowledge base article](https://yikesplugins.com/knowledge-base/importing-custom-tabs-using-the-built-in-woocommerce-csv-importer/)
   without luck. I’ll post it at the bottom for reference, maybe you can spot the
   error.
 * On the importer screen the column gets mapped to “Custom Tabs” and no meta is
   created, I searched the database without results on the product.
 * As my understanding, this column encoded to JSON must be decoded and then inserted
   onto meta yikes_woo_products_tabs but this is not happening.
 * I also tried on the importer to select instead of “Custom Tabs” select “import
   as meta” and the JSON is inserted in the database instead of the decoded JSON.
 * I know I’m really close to get this done, any further help would be appreciated.
 * Thank you.
 *     ```
       function add_column_to_importer($options)
       {
       	// column slug => column name
       	$options['yikes_woo_products_tabs'] = 'Custom Tabs';
   
       	return $options;
       }
       add_filter('woocommerce_csv_product_import_mapping_options', 'add_column_to_importer');
   
       function add_column_to_mapping_screen($columns)
       {
       	// potential column name => column slug
       	$columns['Custom Tabs'] = 'yikes_woo_products_tabs';
   
       	return $columns;
       }
       add_filter('woocommerce_csv_product_import_mapping_default_columns', 'add_column_to_mapping_screen');
   
       function process_import($object, $data)
       {
       	if (!empty($data['yikes_woo_products_tabs'])) {
       		$arr = json_decode($data['yikes_woo_products_tabs'], true);
       		$object->update_meta_data('yikes_woo_products_tabs', $arr);
       	}
   
       	return $object;
       }
       add_filter('woocommerce_product_import_pre_insert_product_object', 'process_import', 10, 2);
       ```
   
 *  [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * (@jpowersdev)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15058393)
 * Hi [@danidub](https://wordpress.org/support/users/danidub/),
 * Correct, you are almost there!
 * If the JSON isn’t being decoded, you may just want to add some logging between
   the decoding and the saving to see what’s happening. You can run the import with
   just a single product to avoid drowning in logs. Something like `error_log(print_r(
   $data, true));` will output the entire row, so you can see all the keys and their
   format in your site’s `debug.log`.
 * I don’t see anything immediately wrong, which is why I’m suggesting the logging.
 * Let me know what you find,
    Jon
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15058814)
 * Hey [@jpowersdev](https://wordpress.org/support/users/jpowersdev/),
 * If I put the JSON that I have on the CSV into a variable on the importer script
   and decode it, it works and it adds the data to the database in the correct way,
   but for some reason when the importer reads the JSON on the CSV it outputs nothing.
 * I have compared on the `error_log` output the JSON and seems to be invalid. Is
   like both JSON are different when reading the CSV.
 * This is really weird as the JSON is valid on the CSV but seem to be invalid when
   it arrives to the PHP function. I have opened with VSCode the CSV and seems to
   have double quotes instead of one. Maybe is something related with this?
 * The valid JSON that is on the CSV:
 *     ```
       [{"title":"MANZANA & CANELA","id":"manzana-canela","content":"<h4>INGREDIENTES<\/h4>\r\nPasta de higo, pasta de d\u00e1til, semillas de calabazas*, manzana deshidratada troceada*, aceite de girasol*, pasas sultanas* (pasas> 99,5%, aceite de girasol ecol\u00f3gico <0.7%), amino\u00e1cidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitam\u00ednico, amilopectina, canela en polvo*, aroma natural de manzana. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n[caption id=\"attachment_10252\" align=\"alignnone\" width=\"1226\"]<img class=\"size-full wp-image-10252\" src=\"https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/informacion-nutricional-race-day-bar-manzana-canela.png\" alt=\"Informaci\u00f3n Nutricional Race Day Bar - Manzana & Canela\" width=\"1226\" height=\"980\" \/> Informaci\u00f3n Nutricional Race Day Bar - Manzana & Canela[\/caption]"},{"title":"BANANA & JENGIBRE","id":"banana-jengibre","content":"<h4>INGREDIENTES<\/h4>\r\nPasta de higo, pasta de d\u00e1til, banana flakes, aceite de girasol*, amilopectina, amino\u00e1cidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), semillas de calabaza*, complejo vitam\u00ednico, jengibre en polvo*, aroma natural de pl\u00e1tano. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n[caption id=\"attachment_10251\" align=\"alignnone\" width=\"1228\"]<img class=\"size-full wp-image-10251\" src=\"https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/informacion-nutricional-race-day-bar-banana-jengibre.png\" alt=\"Informaci\u00f3n Nutricional Race Day Bar - Banana & Jengibre\" width=\"1228\" height=\"986\" \/> Informaci\u00f3n Nutricional Race Day Bar - Banana & Jengibre[\/caption]"},{"title":"CHOCOLATE NEGRO","id":"chocolate-negro","content":"<h4 style=\"font-weight: 500; color: #000000;\">INGREDIENTES<\/h4>\r\n<p style=\"font-weight: 500; color: #000000;\">Pasta de higo, pasta de d\u00e1til, cacao en polvo desgrasado natural, semillas de calabaza*, aceite de girasol*, pasas sultanas* (pasas > 99.5%, aceite de girasol ecol\u00f3gico < 0.7%)*, pepitas de chocolate* (pasta de cacao > 50%, az\u00facar de ca\u00f1a ecol\u00f3gica, manteca de cacao, emulsificante: lecitina de soja)*, aroma natural de chocolate, amilopectina, amino\u00e1cidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitam\u00ednico. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.<\/p>\r\n\r\n\r\n[caption id=\"attachment_10250\" align=\"alignnone\" width=\"1232\"]<img class=\"size-full wp-image-10250\" src=\"https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/informacion-nutricional-race-day-bar-chocolate-negro.png\" alt=\"Informaci\u00f3n Nutricional Race Day Bar - Chocolate Negro\" width=\"1232\" height=\"986\" \/> Informaci\u00f3n Nutricional Race Day Bar - Chocolate Negro[\/caption]"},{"title":"CHOCOLATE BLANCO Y FRESA","id":"chocolate-blanco-y-fresa","content":"<h4 style=\"font-weight: 500; color: #000000;\">INGREDIENTES<\/h4>\r\n<span style=\"font-weight: 500; color: #000000;\">Pasta de higo, pasta de d\u00e1til*, fresa en polvo, semillas de calabaza*, pepitas de chocolate blanco (leche, soja), aceite de girasol*, complejo vitam\u00ednico, amilopectina de arroz, aroma natural de fresa. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.<\/span>\r\n\r\n[caption id=\"attachment_16031\" align=\"alignnone\" width=\"500\"]<img class=\"wp-image-16031 \" src=\"https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/valor-nutricional-race-day-bar-chocolate-blanco-fresa.png\" alt=\"Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa\" width=\"500\" height=\"411\" \/> Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa[\/caption]"},{"title":"LIM\u00d3N","id":"limon","content":"<h4 style=\"font-weight: 500; color: #000000;\">INGREDIENTES<\/h4>\r\n<span style=\"font-weight: 500; color: #000000;\">Pasta de higo, pasta de d\u00e1til*, pepitas de chocolate negro*(soja), semillas de calabaza*, lim\u00f3n en flakes, aceite de girasol*, lim\u00f3n en polvo, complejo vitam\u00ednico, amilopectina de arroz. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.<\/span>\r\n\r\n[caption id=\"attachment_16032\" align=\"alignnone\" width=\"500\"]<img class=\"wp-image-16032 \" src=\"https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/valor-nutricional-race-day-bar-limon.png\" alt=\"Valor Nutricional Race Day Bar - Lim\u00f3n\" width=\"500\" height=\"413\" \/> Valor Nutricional Race Day Bar - Lim\u00f3n[\/caption]"}]
       ```
   
 * The JSON that the error_log sees when running the script (invalid):
 *     ```
       [{"title":"MANZANA & CANELA","id":"manzana-canela","content":"<h4>INGREDIENTES\r\nPasta de higo, pasta de d\u00e1til, semillas de calabazas*, manzana deshidratada troceada*, aceite de girasol*, pasas sultanas* (pasas> 99,5%, aceite de girasol ecol\u00f3gico <0.7%), amino\u00e1cidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitam\u00ednico, amilopectina, canela en polvo*, aroma natural de manzana. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n[caption id=\"attachment_10252\" align=\"alignnone\" width=\"1226\"]<img class="size-full wp-image-10252" src="https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/informacion-nutricional-race-day-bar-manzana-canela.png" alt="Informaci\u00f3n Nutricional Race Day Bar - Manzana & Canela" width="1226" height="980" /> Informaci\u00f3n Nutricional Race Day Bar - Manzana & Canela[\/caption]"},{"title":"BANANA & JENGIBRE","id":"banana-jengibre","content":"<h4>INGREDIENTES\r\nPasta de higo, pasta de d\u00e1til, banana flakes, aceite de girasol*, amilopectina, amino\u00e1cidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), semillas de calabaza*, complejo vitam\u00ednico, jengibre en polvo*, aroma natural de pl\u00e1tano. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n[caption id=\"attachment_10251\" align=\"alignnone\" width=\"1228\"]<img class="size-full wp-image-10251" src="https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/informacion-nutricional-race-day-bar-banana-jengibre.png" alt="Informaci\u00f3n Nutricional Race Day Bar - Banana & Jengibre" width="1228" height="986" /> Informaci\u00f3n Nutricional Race Day Bar - Banana & Jengibre[\/caption]"},{"title":"CHOCOLATE NEGRO","id":"chocolate-negro","content":"<h4 style="font-weight: 500;color: #000000">INGREDIENTES\r\n<p style="font-weight: 500;color: #000000">Pasta de higo, pasta de d\u00e1til, cacao en polvo desgrasado natural, semillas de calabaza*, aceite de girasol*, pasas sultanas* (pasas > 99.5%, aceite de girasol ecol\u00f3gico < 0.7%)*, pepitas de chocolate* (pasta de cacao > 50%, az\u00facar de ca\u00f1a ecol\u00f3gica, manteca de cacao, emulsificante: lecitina de soja)*, aroma natural de chocolate, amilopectina, amino\u00e1cidos ramificados 8:1:1 (L-leucina, L-isoleucina, L-valina), complejo vitam\u00ednico. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n\r\n[caption id=\"attachment_10250\" align=\"alignnone\" width=\"1232\"]<img class="size-full wp-image-10250" src="https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/informacion-nutricional-race-day-bar-chocolate-negro.png" alt="Informaci\u00f3n Nutricional Race Day Bar - Chocolate Negro" width="1232" height="986" /> Informaci\u00f3n Nutricional Race Day Bar - Chocolate Negro[\/caption]"},{"title":"CHOCOLATE BLANCO Y FRESA","id":"chocolate-blanco-y-fresa","content":"<h4 style="font-weight: 500;color: #000000">INGREDIENTES\r\n<span style="font-weight: 500;color: #000000">Pasta de higo, pasta de d\u00e1til*, fresa en polvo, semillas de calabaza*, pepitas de chocolate blanco (leche, soja), aceite de girasol*, complejo vitam\u00ednico, amilopectina de arroz, aroma natural de fresa. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n[caption id=\"attachment_16031\" align=\"alignnone\" width=\"500\"]<img class="wp-image-16031 " src="https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/valor-nutricional-race-day-bar-chocolate-blanco-fresa.png" alt="Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa" width="500" height="411" /> Valor Nutricional Race Day Bar - Chocolate Blanco y Fresa[\/caption]"},{"title":"LIM\u00d3N","id":"limon","content":"<h4 style="font-weight: 500;color: #000000">INGREDIENTES\r\n<span style="font-weight: 500;color: #000000">Pasta de higo, pasta de d\u00e1til*, pepitas de chocolate negro*(soja), semillas de calabaza*, lim\u00f3n en flakes, aceite de girasol*, lim\u00f3n en polvo, complejo vitam\u00ednico, amilopectina de arroz. *Proviene de agricultura ecol\u00f3gica. Sin ingredientes animales. No GMO.\r\n\r\n[caption id=\"attachment_16032\" align=\"alignnone\" width=\"500\"]<img class="wp-image-16032 " src="https:\/\/findyoureverest.es\/wp-content\/uploads\/2020\/03\/valor-nutricional-race-day-bar-limon.png" alt="Valor Nutricional Race Day Bar - Lim\u00f3n" width="500" height="413" /> Valor Nutricional Race Day Bar - Lim\u00f3n[\/caption]"}]
       ```
   
 *  Thread Starter [Daniel P.](https://wordpress.org/support/users/danidub/)
 * (@danidub)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/#post-15058820)
 * If you parse both JSON with an [online tool like this one](http://json.parser.online.fr)
   you can see the first being valid and the second being invalid.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/export-not-including-data/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/export-not-including-data/page/2/?output_format=md)

The topic ‘Export not including data’ is closed to new replies.

 * ![](https://ps.w.org/yikes-inc-easy-custom-woocommerce-product-tabs/assets/icon-
   256x256.png?rev=1558461)
 * [Custom Product Tabs for WooCommerce](https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/)
 * [Active Topics](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/reviews/)

## Tags

 * [import export](https://wordpress.org/support/topic-tag/import-export/)

 * 21 replies
 * 2 participants
 * Last reply from: [jpowersdev](https://wordpress.org/support/users/jpowersdev/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/export-not-including-data/page/2/#post-15069426)
 * Status: resolved