Support » Plugins and Hacks » [Resolved] Posts still in database

[Resolved] Posts still in database

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author finnj



    I am not sure, but I expect that only valid posts with a known (valid) status are shown.

    More info: Codex

    If I execute the following query in my test DB

    SELECT post_status, count(*) FROM wpt_posts GROUP BY post_status

    I get this result

    post_status count(*)
    afventergennemlsning 1
    auto-draft 8
    draft 4
    inherit 177
    pending 8
    publish 83
    trash 1
    udgivet 3

    afventergennemlsning is the Danish translation of pending, and udgivet is the Danish translation of publish – None of these 4 posts are shown in the admin panel

    How to call those posts?
    Are you aware of a plugin to fix this issue?
    Thank you

    Plugin Author finnj



    I have uploaded a fix to the Development version which you can download here: Development version

    * Install the development version (has version number 1.6.0)
    * Create a new page (you could name it status fix), and insert shortcode [frontier-status-fix]
    * Publish the page, and press View page.
    * Then you will see a list of posts with wrong status, and a link so you can edit the posts from Frontier, and set a valid status

    I suggest that you save the post with status Draft, and then delete it from the admin interface if needed.

    Plugin Author finnj


    A bit more info on the fix:
    * It a copy of the list showing My Posts with a modified query showing posts with non valid post_status
    * It can only be executed by an administrator
    * In the list there is a link so you can edit the post in front end (and thereby change the status)
    * It does not change anything in the background, you need to edit the post.

    I believe it is a secure way of doing it.

    The modified quesry:

    SELECT *
     FROM $wpdb->posts
     WHERE $wpdb->posts.post_status NOT IN ('auto-draft', 'draft', 'future', 'inherit','pending', 'publish', 'trash')"

    As an alternative you can change the status manually in myphpadmin (MySQL tool from your provider). The SQL to use to list the posts

    SELECT *
     FROM wp_posts
     WHERE wp_posts.post_status NOT IN ('auto-draft', 'draft', 'future', 'inherit','pending', 'publish', 'trash')"

    You must replace “wp_” with the appropriate prefix (can be found in wp-config.php)

    $table_prefix  = 'wp_';

    Thank you 😉
    Maybe to say “GREAT! No posts with wrong status”.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Posts still in database’ is closed to new replies.