Forums

Post many articles through database at same time? (4 posts)

  1. glenv
    Member
    Posted 1 year ago #

    I just discovered while looking at my admin panel that somehow I have 150 unpublished articles that at one time were published. I suspect this is due to negligence on the person's fault I hired to move the site several months ago. I cannot imagine how else it happened. Anyway, to republish all these will take hours. Is there a command I can utilize in MySQL to publish all unpublished articles?

    I am a MySQL novice so it needs to be a simple process please.

    Thanks in advance.

    Glen

  2. VelvetBlues.com
    Member
    Posted 1 year ago #

    Well, this is a bit strange. Well, I assume that the posts could either have one of 2 statuses: either 'draft' or ''.

    So these two commands should work:

    UPDATE wp_posts SET post_status = replace(post_status, '','publish');

    UPDATE wp_posts SET post_status = replace(post_status, 'draft','publish');

    The only problem would be that any true draft posts would be published.

    You could also just manually sort the table columns and check off items that you wanted to edit.

  3. glenv
    Member
    Posted 1 year ago #

    Thank you. It appears in WP 2.62 the posts in question show up as "pending review". I ran the queries as you gave them but nothing seemed to update.

    Any other ideas?

    Thank you

  4. VelvetBlues.com
    Member
    Posted 1 year ago #

    Oh, pending! ok. Then I guessed wrong. lol.

    Use this query:

    UPDATE wp_posts SET post_status = replace(post_status, 'pending','publish');

    Sorry about that. Let me know how this works. (The only other thing would be if the dates were wrong and in the future. But if they are pending review, then this should work.)

Topic Closed

This topic has been closed to new replies.

About this Topic