WordPress.org

Ready to get started?Download WordPress

Forums

Delete All Posts by an Author --- if the author has a large number of posts (3 posts)

  1. everwill
    Member
    Posted 1 year ago #

    I'm using WP MU and I need to delete all posts by a single author. The trouble is that means deleting 19,000 posts. Even 100 at a time this is a daunting task. Please share and easier way.

    [Moved to Multisite by moderator]

  2. bottleneck
    Member
    Posted 1 year ago #

    Backup Database First

    Database query:

    1. Run (just to make sure it reads his 19000 posts)

    select *from wp_posts WHERE post_author='n'
    replace 'n' with his number (find it out in the database)

    2. Run
    delete *from wp_posts WHERE post_author='n'

    Once again, backup your database first, there could be your WP MU environment limitation or else.

    I would recommend to create a new author, publish a few dummy posts and run these two snippets ( just to make sure it works ) before killing a big fish.

  3. bottleneck
    Member
    Posted 1 year ago #

    corrected

    instead of

    delete *from wp_posts WHERE post_author='n'

    run

    delete from wp_posts WHERE post_author='n'

Topic Closed

This topic has been closed to new replies.

About this Topic