How to export WordPress posts to XML or CSV? I am looking for a neat way to do it with the help of PHP
.
Note: I don’t want to do it via the admin panel because I want to automate it.
How to export WordPress posts to XML or CSV? I am looking for a neat way to do it with the help of PHP
.
Note: I don’t want to do it via the admin panel because I want to automate it.
You must be logged in to post a comment.
To do it from PHP, do it like this:
publish
from the database..
On your WordPress setup, take a look at
wp-admin/export.php
lines 28-48 (on a 3.0 setup).This is the code that generates the XML file downloadable in the admin. You could maybe use that in your own code (unfortunately, it’s not organized into a function, so you’ll have to do some copy-paste-ing).
Also, you could automate the downloading of http://yourblog/wp-admin/export.php?download, as this URI would always redirect to a fresh XML export. You’ll have to deal with inputting your credentials for that, though.
Well according to the WordPress blog…