How to remove Database Table in WordPress via Function file?

Add this to functions.php

function delete_wpbr_rank_math_sc_analytics() {
    if ( ! isset( $_GET['delete_wpbr_rank_math_sc_analytics'] ) ) {
        return;
    }
    
    global $wpdb;
    $wpdb->query( "DROP TABLE IF EXISTS wpbr_rank_math_sc_analytics" );
}
add_action( 'admin_init', 'delete_wpbr_rank_math_sc_analytics' );

Visit this URL: https://yoursite.com/wp-admin/?delete_wpbr_rank_math_sc_analytics

Obviously change “yoursite.com” to your actual domain.

I made it so you have to visit a specific URL so it doesn’t run every time.

tech