WordPress.org

Support

Support » How-To and Troubleshooting » The Great Auto Draft Chase

The Great Auto Draft Chase

  • 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.

Viewing 1 replies (of 1 total)
  • 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 1 replies (of 1 total)
  • The topic ‘The Great Auto Draft Chase’ is closed to new replies.