I am doing a large data import for a custom post type that uses custom fields. For each post I have several custom fields that are images and several that are pdfs. I can upload the attachments to the media library, but what do I need to put in my csv file so that the attachments will be connected to the posts correctly in the database?
Follow these steps,
* import all pdf files to media.
* get the file url from media.
* copy and paste the url in the csv under the custom field column.
* repeat the above steps 2 and 3 for all posts and save as csv file with UTF-8 format.
then import the csv and map the column with the existing custom field.