The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Multisite phpmyadmin-delete multiple tables with prefix wp_xx_ (3 posts)

  1. valuser
    Posted 3 years ago #

    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 http://i.imgur.com/sjoVP0J.png

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

    Any help at all much appreciated

  2. valuser
    Posted 3 years ago #

    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!

  3. valuser
    Posted 3 years ago #


    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!

Topic Closed

This topic has been closed to new replies.

About this Topic