WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


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? – markratledge Oct 10 '12 at 19:25

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


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.