WordPress.org

Ready to get started?Download WordPress

Forums

Script to add data to wp db tables from an XML file using PHP (5 posts)

  1. PBWordpressDP
    Member
    Posted 2 years ago #

    I need a script to add data to wp db tables from an XML file using PHP?

    I then need to automate the execution of this script.

    Thanks

  2. PBWordpressDP
    Member
    Posted 2 years ago #

    Also, where is the code or function that executes the import XML file when you hit the import button. Perhaps this code would be of some use.

  3. Andrew Bartel
    Member
    Posted 2 years ago #

    Where exactly are you importing xml files? What table do you want to write to? You automate execution by setting up cron jobs in your server configuration.

  4. PBWordpressDP
    Member
    Posted 2 years ago #

    I want to add entries to the wp_postmeta table. There are a number of entries added in a single item entry from the XML.

    A content provider will upload xml files to a ftp folder, and a script will import the newly added XML file(which will add new items) into the wp_postmeta table.

  5. PBWordpressDP
    Member
    Posted 2 years ago #

    I am currently able to import an XML file through Tools->Import->WordPress (selecting a WXR (xml)) file. This populates the wp_postmeta as expected. I now just want to automate this process. So I would simply drop an XML file into a folder, and a scheduled script would automatically do the rest.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.