Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to export all WordPress Posts and related Meta information using an SQL query. I've managed to export just the Posts but realised that the Meta information is in another table.

Could someone please tell me how I would go about doing this please?

Thanks!

EDIT: The final outcome of the CSV file should look something like this.

[POSTS TABLE] post_content | post_title | post_excerpt | Author (meta_key) | [META TABLE] AuthorName (meta_value) | Publisher (meta_key) | PublisherName (meta_value) | BookCondition (meta_key) | BookCondition (meta_value)

So one post per row with the meta information in one row but in the same column.

share|improve this question
    
What is the SQL query you are using? –  songdogtech Oct 10 '12 at 19:25

1 Answer 1

What is the SQL query you are using? What are more details of the export and end format you need?

The obvious things are 1) http://wordpress.org/extend/plugins/navayan-csv-export/

"Navayan CSV Export is a wordpress plugin to export all your table data in CSV (Comma Separate Value) format."

and 2), exporting with phpmyadmin - the database utility - into CSV. http://www.phpmyadmin.net/home_page/index.php

phpmyadmin is usually available on web hosts. Use "Export" and then select CSV.

phpmyadmin is also available as a plugin, though only the older versions of the plugin seem bug free: http://wordpress.org/extend/plugins/portable-phpmyadmin/

Will either of these work?

share|improve this answer
    
Hi Songdogtech. I am currently just using the regular export feature built into phpMyAdmin and exporting the CSV file. What I need though, is an SQL query that will pull all the posts and its related Meta information. I could go the plugin route, but this client is going to need a lot more work done to the DB than any other client I have worked with in the past, I so I need to work on my SQL queries going forward. Many thanks for all the suggestions, I will keep them in my WP Toolbag! –  SixfootJames Oct 11 '12 at 7:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.