• I currently have 3.0 installed locally so I can see how everything works before I install it on my site. I was just looking in the database and found a ridiculous number of “auto drafts”. #1. Can anyone tell me what THIS is for? And #2. I use:

    /** Disable autosave */
    define( ‘AUTOSAVE_INTERVAL’, 1000000);

    /** Disable revisions */
    define(‘WP_POST_REVISIONS’, false);

    to disable autosave and revisions. How do I disable this auto draft business?

    Thanks.

    PS: From what I’ve read, the autosave interval thing is supposed to disable drafts which it does in 2.9 but not 3.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Auto drafts are what is created when you first visit the edit page so as to ensure any action you take on the page gets correctly associated with the post.

    Previously there were issues if you tried to upload images before setting any other attributes on a post and thereby creating a draft post.

    On save it will become a real draft and after a while the old ones will be deleted.

    Thread Starter thisisedie

    (@thisisedie)

    Ah. Thank you much for the info :o)

    Thread Starter thisisedie

    (@thisisedie)

    *…*

    To delete these pages you need to use a MySQL front end, go to the posts table, sort on post_status and all the auto-drafts will come to the top for ease of deletion. Seems to be a WP core problem – every time I login or switch to the dashboard page an auto draft is created unless there is one in the posts table already. Search Unleashed finds them, which is a further embarrassment, and duplicates can be created.

    I wonder about the post id with these autodrafts. Say, I’ve logged into the admin panel, it created an autodraft. Then I log off and later return to write a post. Will the post be made from this autodraft and thus keep its id, or will it be a completely new entry in the database with a new post id?

    I must say that WP is starting to seriously disappoint me. First the strange stance on revisions, making users edit core files instead of making it an accessible setting. Then the revisions and autosave settings are moved from the settings file altogether somewhere much less obvious. And now this. I’m afraid to even think of what other “user friendly” features there are going to turn up with the next update.

    If a plugin or theme does not handle these auto draft pages correctly, you need to do some PHP coding. Here is the filter I have added to the Misty Look theme’s search.php module to get rid of auto draft and trash items that Search Unleashed returns incorrectly:

    <?php $p_status = get_post_status( $post );
           if ($p_status != 'trash' and $p_status != 'auto-draft') : ?>

    Followed later on by:

    <?php else: echo 'One irrelevant ',$p_status,' item not shown here.';
           endif; ?>

    This sort of change is very easily done if you use the ‘child theme’ facilities of WordPress.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Auto Draft’ is closed to new replies.