[Closed] import CSV data into checkboxes field (WP All Import)
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
So I created an export to get the correct strings for the fields and options BUT even though I have tried multiple variations I don't manage to get the values imported. What is the "trick" of this workaround to make it work? (I may be wrong but my guess is that it is tied to the separator / separation method for the multiple selected options within the field)
I even don't manage to re-import data I exported with WP All Export (with the normal dialogue, not the "migrate" function) 🤔
The structure of the field export looks like this:
a:4:{s:64:"wpcf-fields-checkboxes-option-7de40175f4c9a1e0e724987378dedb99-1";a:1:{i:0;s:14:"Asylum seekers";}s:64:"wpcf-fields-checkboxes-option-562533c646142de563401931a5f500f2-1";a:1:{i:0;s:20:"Unaccompanied minors";}s:64:"wpcf-fields-checkboxes-option-afe9ab2ac5ac80f1c9440bd313a82bd7-1";a:1:{i:0;s:17:"Economic migrants";}s:64:"wpcf-fields-checkboxes-option-e91cc0f7a184718576d8302d98eeb4f9-1";a:1:{i:0;s:5:"Other";}}
I understand that the numbers with the a are entry counters, so if I have 2 active options it's a 2 and if I have 4 active options it's a 4. The numbers with the s seem to be character counters, so they are tied to the respective options.
In this export there seems to be no separator, so I tried with comma, semicolon, space etc as separator too, but nothing works.
Hello. Thank you for contacting the Toolset support.
I understand that the numbers with the a are entry counters, so if I have 2 active options it's a 2 and if I have 4 active options it's a 4. The numbers with the s seem to be character counters, so they are tied to the respective options.
===>
Yes, thats correct.
So, if you want to set three options, the CSV should hold the following value:
a:3:{s:64:"wpcf-fields-checkboxes-option-562533c646142de563401931a5f500f2-1";a:1:{i:0;s:20:"Unaccompanied minors";}s:64:"wpcf-fields-checkboxes-option-afe9ab2ac5ac80f1c9440bd313a82bd7-1";a:1:{i:0;s:17:"Economic migrants";}s:64:"wpcf-fields-checkboxes-option-e91cc0f7a184718576d8302d98eeb4f9-1";a:1:{i:0;s:5:"Other";}}
If you want to set only the first option, then the CSV should hold the following value:
a:1:{s:64:"wpcf-fields-checkboxes-option-7de40175f4c9a1e0e724987378dedb99-1";a:1:{i:0;s:14:"Asylum seekers";}}
No unfortunately it doesn't work. I have copied the exact value for 1 checkbox from your post into the CSV and even this is not imported (see screenshot). Even though this is the exact term to write into the database, the postmeta for meta_key wpcf-migrant-types of the imported line is: a:0:{}
I mean, when I just have the displayed value in the field, it at least imports me the first value.
"Meeting rooms, High-speed internet, Private offices" turns into
a:1:{s:64:"wpcf-fields-checkboxes-option-4ce888e2d7cd9905aad0effa89013f3e-1";a:1:{i:0;s:13:"Meeting rooms";}}
With the exact value for the database the result is nothing checked at all…
Where is the one point that makes everything null?
I have also tried to import the values directly into the postmeta table. A CSV with 4 columns meta_id, post_id, meta_key, meta_value. However I always end up with a "incorrect number of columns in CSV import in row 1" error.
I am a bit desperate, how can I at least make this workaround work?
Can you please send me the CSV you are using and also setup a staging site where I should try to upload the said CSV and check what's going wrong with your setup.
Please share details for what post type you are trying to import the posts as well as what is the checkboxes custom field name.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
The topic ‘[Closed] import CSV data into checkboxes field (WP All Import)’ is closed to new replies.