1

I have a Custom Post Type called movies which had only title enabled from post support and 3 custom field of metabax as box office, year, and director like

enter image description here

now I have like 150 rows CSV formatted stored data whith same structure as

name, boxoffice,year,director

can you please let me know how I can load them into WP database to keep both Custom Post Type and metadat in the database using PHP

3
  • Is the idea that you want to be able to upload and process CSV files regularly, or allow others to do it, or just that you want to be handle one or a couple uploads? It may well be easier to "load them into the WP db" using WP functions acting directly on the data and producing posts and post meta (which reside in the database), than to upload the data into the the db and then extract it or re-extract it.
    – CK MacLeod
    Aug 29, 2018 at 1:49
  • Hi, thanks for reply . This actually only one time loading data to the database and for first time( I am not getting any SQL data from existing database)
    – Mona Coder
    Aug 29, 2018 at 18:00
  • I was thinking about leaving the outlines of my own approach to this problem as an answer, but, looking for the quickest way to parse a CSV file, I ran into this post: sitepoint.com/… You could probably skip much of it and just get to the use of fgetcsv() and following code, but, depending on your level of coding knowledge, you might actually find it easier to install the entire thing even for one-time use.
    – CK MacLeod
    Aug 30, 2018 at 8:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.