Title: Programmatically Create Posts with Excel
Last modified: August 19, 2016

---

# Programmatically Create Posts with Excel

 *  [travelvice](https://wordpress.org/support/users/travelvice/)
 * (@travelvice)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/programmatically-create-posts-with-excel-6/)
 * 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](http://www.yagci.com/use-excel-for-batch-posting-in-wordpress/)
   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](http://www.g-loaded.eu/2006/01/05/add-meta-tags-wordpress-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](http://travelvice.com)

Viewing 1 replies (of 1 total)

 *  [steinitz](https://wordpress.org/support/users/steinitz/)
 * (@steinitz)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/programmatically-create-posts-with-excel-6/#post-669283)
 * 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.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 1 reply
 * 2 participants
 * Last reply from: [steinitz](https://wordpress.org/support/users/steinitz/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/programmatically-create-posts-with-excel-6/#post-669283)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
