• Hello!

    I have tried to set a lot of posts (over 120.000) to publish via MySql which were previously uploaded as drafts. I managed to do this and it shows the posts in the loop but there are no links generated with them so I can’t click on them and enter the post itself.

    Does wordpress generate links afterwards? Do I have to do something else in MySQL? I also noticed that the column “post_name” is empty for all of the draft posts and for publish posts not.

    Thank you for your help in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anonymous User 14733231

    (@anonymized-14733231)

    Hello Try to Run Query in mysql please backup once before you run query.

      SQL Query:

    Set Your Table Name instead of given bellow

    UPDATE “.$wpdb->posts.” SET post_status = ‘publish’, post_name = ‘”.sanitize_title ($post->post_title).”‘ WHERE id = “.$post->ID;

    Anonymous User 14733231

    (@anonymized-14733231)

    OR You Can Try:

    UPDATE wp_posts SET post_status = ‘publish’ WHERE post_status = ‘draft’

    Thread Starter M4rk0444

    (@m4rk0444)

    Hello Neal!

    Thank you for your help! I will try your first version. It needs to be applied on over 100.000 entries. I hope that this is performant.

    I already tried the second version. The posts were published but without links. So I could’nt enter the posts.

    Anonymous User 14733231

    (@anonymized-14733231)

    OK No Pronlem

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Set to 'publish' via MySQL’ is closed to new replies.