Forums

Importing posts as DRAFTS (4 posts)

  1. hanexs
    Member
    Posted 4 years ago #

    I am importing a lot of recipes to a recipe site I am making. I have used some code i found from this post http://wordpress.org/support/topic/146915?replies=7 to import all the recipes. It works great. I have a couple problems though

    I would like the posts to be automatically made as DRAFTS, so I review them and then publish them every couple of days.

    I can't find what I would insert into the RSS to mark it as a draft. I tried <wp-status>Draft, which I found on these boards, but it didnt work.

    Anyways the blog is empty, so if there was a way to turn ALL posts into drafts, that would work too.

    This is the format of every post:
    <item>
    <title>CNN</title>
    <description>
    The last global channel. http://www.cnn.com
    </description>
    <category>TV</category>
    </item>

    Is there anything I could insert into that to mark the post as a draft?

    Thanks for the help!

    Hanexs

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Add this to each post:

    <wp:status>draft</wp:status>

  3. hanexs
    Member
    Posted 4 years ago #

    Tried it, still not working. If I import it in as an RSS File, it imports fine but comes in published. If I import it in as a wordpress file it comes in as draft, but I lose the entire post (everything between the description tag). Any solutions?

    Here is the format im using.

    <item>
    <title>DIABETIC DATE DAINTIES</title>
    <wp:status>draft</wp:status>
    <description> 2 eggs
    1 1/2 tsp. liquid sweetener
    </description>
    <category>Diabetic Recipes</category>
    <category>Deserts</category>
    </item>

  4. Kafkaesqui
    Moderator
    Posted 4 years ago #

    When importing through the WordPress import (the one that will accept post status), you need to move the content you have under <description> into a <content:encoded> element. Inside the element you also want to block it into a <![CDATA[ .. ]]> section (this is an XML component that informs XML parsers to ignore it, i.e. leave as is).

    Your example would then look like:

    <item>
    <title>DIABETIC DATE DAINTIES</title>
    <wp:status>draft</wp:status>
    <description></description>
    <content:encoded><![CDATA[2 eggs
    1 1/2 tsp. liquid sweetener]]></content:encoded>
    <category>Diabetic Recipes</category>
    <category>Deserts</category>
    </item>

    P.S. Probably should be the Desserts category. :)

Topic Closed

This topic has been closed to new replies.

About this Topic