WordPress.org

Ready to get started?Download WordPress

Forums

The Great Auto Draft Chase (2 posts)

  1. Anthony Butler
    Member
    Posted 4 years ago #

    A good deal of confusion has resulted from the WP auto draft implementation. Here is what I have found in my testing.

    1. An auto draft post is written to the posts table whenever you login or access the dashboard screen - unless there is such a post in the table already.

    2. An auto draft post is written to the posts table whenever you access the 'new post' screen. It remains there whether you complete the post or move away to a different screen.

    3. To delete these posts you need to use a MySQL front end and access the posts table directly. Sorting on post_status brings all the 'auto-drafts' to the top for ease of deletion.

    You should not have to worry about this planned WP technical feature, if the theme and plugins you use are up-to-date and exclude such special posts. I encountered problems with the Search Unleashed plugin (no longer maintained): it retrieved all these auto draft posts, as well as posts in Trash! If you experience theme or plugin problems, it may be a sign the theme or plugin is no longer maintained.

  2. Anthony Butler
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags