最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - How to remove Database Table in Wordpress via Function file?

programmeradmin1浏览0评论

I recently installed Rankmath, I am using different Page Builder, Where the content not readable by the Plugin. So I disabled SEO Analysis from Setting. Now I wonder if we can remove this Table from Daba via functions.php. I think removing this table will improve load time.

Table Name : "wpbr_rank_math_sc_analytics"

I recently installed Rankmath, I am using different Page Builder, Where the content not readable by the Plugin. So I disabled SEO Analysis from Setting. Now I wonder if we can remove this Table from Daba via functions.php. I think removing this table will improve load time.

Table Name : "wpbr_rank_math_sc_analytics"

Share Improve this question edited Aug 11, 2020 at 19:48 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Aug 11, 2020 at 16:19 Nisha_at_BehanceNisha_at_Behance 7032 gold badges7 silver badges14 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

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/wp-admin/?delete_wpbr_rank_math_sc_analytics

Obviously change "yoursite" to your actual domain.

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

发布评论

评论列表(0)

  1. 暂无评论