Forums

[resolved] Find & Replace query - post_status (3 posts)

  1. boutwell
    Member
    Posted 5 years ago #

    I somehow ended up with most of my posts having nothing in the "post_status" column. I have tried using:

    UPDATE wp_posts SET post_status = REPLACE(post_status ,'' ,'published' );

    But no entries are effected. I know I am really showing my ignorance here, but could anyone help me out? The posts are not showing and doign it manually will take days. I am pretty sure the query above is not working because its a combo box rather than a text field (I know those are not the correct terms...again, I am not a db guy).

    Can anyone help me out with the correct query to use?

    Thanks,

    Boutwell

  2. Kafkaesqui
    Moderator
    Posted 5 years ago #

    Try:

    UPDATE wp_posts SET post_status = 'publish' WHERE post_status = '';

  3. boutwell
    Member
    Posted 5 years ago #

    Worked like a charm, Kafkaesqui. Thank you very much :)

    Boutwell

Topic Closed

This topic has been closed to new replies.

About this Topic