• I’m interesting in dumping the slow recorded mouse/keyboard macro I’ve been using to add a spreadsheet full of new posts into WordPress, in place of an import.

    It seems there are two primary ways to go about doing this:
    1. Excel file converted to a CSV for SQL insert
    2. Excel file converted to an XML document and imported as an RSS file

    One of the snags that I’m dealing with — that I can’t seem to find any answers to — is what to do about data that must be placed in tables other than wp_posts, where the unique post ID is used as a reference to that relationship.

    Additionally, I can’t seem to find an answer to the question of adding posts to more than one category using RSS, and if I can add custom field information via an RSS feed import.

    The Data
    The situation is simple. I have these fields:
    * title
    * content
    * category
    * description

    There will always be at least two categories for every post (such as “Peru, Visas” contained in the spreadsheet cell — though these could be tweaked to contain the pre-created category ID, not their names).

    ‘Description’ is a custom field that is used to insert the META data in the HTML HEAD (using this plugin).

    Thoughts?

    How can I best import several hundred posts with a file in this format? I will be doing this repeatedly, and am not sure if RSS or the CSV file import is the proper to be going after.

    If importing directly into the database is your suggestion, how do I properly append data to the wp_postmeta and wp_term_relationships tables, referencing a post ID that’s created on the fly?

    If importing using RSS is the solution, how do I properly format the data to be exported?

    Thank you all for your help — and for helping others searching on this task.

    //craig, travelvice.com

Viewing 1 replies (of 1 total)
  • Hi Craig,

    Did you get anywhere with this? I’ve recently had a similar idea, except I want to take an LSI-grouped keyword list, create a silo category structure and populate it with unpublished empty articles with the keywords as the titles.

    I’m thinking XML-RPC.

    Cheers,

    Steve

Viewing 1 replies (of 1 total)
  • The topic ‘Programmatically Create Posts with Excel’ is closed to new replies.