WordPress.org

Ready to get started?Download WordPress

Forums

CSV Importer
How to Download Current Posts for Structure? (2 posts)

  1. blogthisnow
    Member
    Posted 1 year ago #

    My current posts have a structure.. with another plugin managing some of the custom fields.

    The big problem is I don't know how to know what all I should put in the excel worksheet.

    Shouldn't there be a download current posts option on this plugin so we can work out the column names?

    Surely it make sense or if not - does anyone have instructions for this?

    Thanks in advance.

    http://wordpress.org/extend/plugins/csv-importer/

  2. bheadrick
    Member
    Posted 1 year ago #

    Hmm. that sounds like a good feature to have. I've considered including template files, but this would make analysis for importing a lot easier.

    The following sql query will give you the data you need to build the spreadsheet, but with the taxonomies and postmeta, it would take a bit more doing to get them all on one row by just using a sql query.

    column names for postmeta is the meta_key
    column names for taxonomies is csv_tax_(taxonomy name) - precede values for heirarchical taxonomies with a comma

    select
    p.id,
    post_title as csv_post_title,
    post_content as csv_post_post,
    post_type as csv_post_type,
    post_excerpt as csv_post_excerpt,
    post_date as csv_post_date,
    post_name as csv_post_slug,
    post_parent as csv_post_parent,
    u.user_login as csv_post_author,
    tt.taxonomy,
    t.name, t.slug,
    pm.meta_key, pm.meta_value
    from wp_posts p
    join wp_users u on p.post_author = u.id
    join wp_term_relationships tr on tr.object_id = p.id
    join wp_term_taxonomy tt on tr.term_taxonomy_id = tt.term_taxonomy_id
    join wp_terms t on t.term_id = tt.term_id
    join wp_postmeta pm on p.id = pm.post_id

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.