WordPress.org

Ready to get started?Download WordPress

Forums

Export WordPress Content in One Category Only (5 posts)

  1. skinnylatte
    Member
    Posted 8 years ago #

    Hi guys, I want to move my wordpress content into another wordpress blog on a subdomain. I have moved all the posts I want into a category, say, the "best of" category - and I want all the posts, and comments from this category, to be exported into the other blog.

    Which mysql rows should I export (in phpmyadmin), and if there's a faster way of doing so via a sql query, what should the syntax be like? Thanks.

  2. Joni
    Member
    Posted 8 years ago #

    How many "other" posts do you have? It may not be worth separating them before migrating them. Also, are you going to use the same basic setup or start from scratch with something new?

    In any event, WP stores all the entries in the "_posts" table. The first thing you need to do is go to your WP Dashboard under Manage, Categories, and find the category ID of the category you want to export. Don't forget that number! In PHPMyAdmin, click on that table. Then click the tab "Browse." You'll see the posts in post ID order. Scroll over a bit and you'll see a column "post_category." Click on it to sort the posts by category id, then scroll down until you see that category ID of posts. Check them all and then export to a *.sql table.

    Ooh, comments. Someone else may have to help with that. They are sorted by comment_post_id. I guess when you are browsing the _posts table you can write down the post ids of all the relevant posts. Then go back to the _comments table and find the matching comment_post_ids there and check only those to export along with your entries. There surely has to be a better way to do that.

  3. skippy
    Member
    Posted 8 years ago #

    If you've already assigned your posts to the desired category, the easiest way to fetch everything is to view the RSS feed for that category. Save the feed as a file, and then specify that file as the source for import-rss.php WordPress importer.

    I think. I've never actually done an RSS import.

    Then you could use the comments feed for each post to import comments.

  4. moshu
    Member
    Posted 8 years ago #

    I have posted about importing a few posts from a blog to another - take a look at it, maybe it can help to figure out the process.
    It is here.

  5. skinnylatte
    Member
    Posted 8 years ago #

    Thanks guys!
    Ludo ran me through it one step at a time, if anyone's interested.

Topic Closed

This topic has been closed to new replies.

About this Topic