Join 3,561 readers in helping fund MetaFilter (Hide)


Importing to Wordpress Using Custom Fields
November 16, 2009 2:15 PM   Subscribe

When importing data into Wordpress, is it possible to put parts of that data into custom fields?

I've got a (Drupal) website with about 1000 pages of content that I'd like to port over to Wordpress. The pages are essentially products, so I think they'd function well as posts.

The one snag I'm running into is that the Drupal pages have the product's content split into a few different sections of content, for example "description", "accessories", "specifications".

Questions:

1) I'm thinking the easiest thing to do would be to have these additional sections be custom fields in Wordpress. When I import the data how can I import these extra sections as custom fields?

2) What's the best format to export the data (or perhaps the better question is, what's the best format to import the data into Wordpress). I have access to the data in sql format, and could write a script in PHP to grab the data directly from the database if need be. Should I manually insert the data into the empty Wordpress database? Or use one of the import methods described in the Wordpress codex?
posted by backwards guitar to Computers & Internet (3 answers total)
 
I'm in the middle of a similar project right now, and I'm going with the "write a script to pull it out of the old db and shove it into the new one" approach.

If you want to go with a built-in import tool, though, writing the old data out in WXR (Wordpress eXtended Rss) format is the way to go. WXR is, I think, the only format that will let you do arbitrary custom fields out of the box. The documentation for WXR is a bit sketchy, so what I did (before abandoning that approach because I just had too much data to import) was to make a clean Wordpress installation, create a few posts in it the way I wanted the final site to be, and then export those. Looking at the resulting file gave me a template to use for the old data.
posted by hades at 7:56 PM on November 16, 2009


Thanks Hades, that's sort of what I've started doing. I think I want to implement some custom taxonomies, so I might have to use your technique to see how WXR spits them out.
posted by backwards guitar at 8:07 PM on November 16, 2009


Followup: I didn't have much luck with importing taxonomies, but I did use the WXR method - creating my own xml file and using custom fields in the XML - to add the separated data.
posted by backwards guitar at 12:20 PM on December 17, 2009


« Older New to copywriting: what is an...   |  Is it possible for bacteria, a... Newer »
This thread is closed to new comments.