• I used bulk delete plugin to send thousands of page to trash. I then realized more than half of those pages were not supposed to be there. Restore function in admin area is painfully slow – anything more then 5-6 pages will timeout. Is there a faster way to restore these pages? I can do SQL too if it’s an easy table update.

Viewing 1 replies (of 1 total)
  • Thread Starter cbquest

    (@cbquest)

    I know it’s not the ideal solution, but had to do this, seem to be OK:

    First, I retrieved all the IDs:

    SELECT ID from wp_posts where post_name in (comma seperated slugs here)

    Then updated posts, and deleted meta keys:

    UPDATE wp_posts SET post_status = ‘publish’, post_name = replace(post_name,’__trashed’)
    WHERE ID in (comma delimited Ids);

    DELETE FROM wp_postmeta where post_id in (Ids here) AND meta_key in (‘_wp_trash_meta_status’,’_wp_trash_meta_time’)

    Now, I am supposed to delete one more key and add another one, but I did not want to do an insert. These queries ran only few seconds for 600+ rows.

Viewing 1 replies (of 1 total)
  • The topic ‘Restore 1000+ posts in trash quicker?’ is closed to new replies.