WordPress.org

Ready to get started?Download WordPress

Forums

Importing XML File From Another Site (2 posts)

  1. foreverlearning
    Member
    Posted 1 year ago #

    Currently when doing an import from another site via an xml file that was exported, the posts go up in the status that they were exported as. I'd like to bring all posts into a new site as drafts, regardless of status from the sending site.

    Thanks in advance.

    Best,

    Dan

  2. Import the XML and then run a query in phpmyadmin to set status of all ]posts to draft:

    UPDATE wp_posts SET post_status = 'draft' WHERE (post_type ='post' and post_status = 'publish') ;

    See http://wordpress.org/support/topic/set-all-entries-to-draft?replies=2 To be safe, back up the database first or be ready to delete all posts and reimport.

    Or, put this at the bottom of the index.php file of the theme, load the page, then delete the line:

    <?php $wpdb->query( "UPDATE wp_posts SET post_status = 'draft' WHERE (post_type ='post' and post_status = 'publish') ; " ); ?>

    Does the same thing, just doesn't require phpmyadmin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags