Support » Fixing WordPress » Multisite phpmyadmin-delete multiple tables with prefix wp_xx_

  • Resolved valuser


    Trying to delete multiple wp multisite tables in phpmyadmin

    Example Task

    delete all tables belonging to site id 73 (currently there are 9 tables)

    i can identify the tables as wp_73_commentmeta, wp_73_comments, etc etc

    Entered the code below in the SQL tab of phpmyadmin

    SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' )
        AS statement FROM information_schema.tables
        WHERE table_schema = 'istheplaDBbb9h3' AND table_name LIKE 'wp_73_%';

    and clicked Go

    the code appears to be accepted and while the tables appear to be identified nothing happens as no rows (0-0) are deleted

    see template image of result at

    Obviously I am omitting something or am in the wrong tab!

    Any help at all much appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • a part solution is :

    DROP TABLE wp_73_commentmeta,wp_73_comments,wp_73_links,wp_73_options,wp_73_postmeta,wp_73_posts,wp_73_terms,wp_73_term_relationships,wp_73_term_taxonomy;

    but if there are lots of tables a wildcard solution would be best ?

    It must be out there somewhere!


    my slow brain has come up with a solution

    with print view from my initial query I can get a ready made drop statement and that is that!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite phpmyadmin-delete multiple tables with prefix wp_xx_’ is closed to new replies.