If You have this posts in database You can pass custom query to $wpdb
and get all data that You need. But first:
- check if data is in database
- write query that works ( i test that in SQL PRO interface )
- do not hardcode prefix in query
- use correct hook (
init
is ok)
than build csv
file.
Hope it works.