Trying to Optimise the Database calls

#84160
  • Resolved Himanshu Ahuja
    Rank Math free

    Hi Team,

    Thanks for such a great plugin.

    We are trying to remove action which is responsible for setting up redirections logic and we don’t need any sought of redirection system in BuddyPress. And our code seems to be not working, we have tried all the possible ways and we checked code and found that its loaded on anonymous class way not in variable. So, there is no other way we can remove this action.
    Here is code we are using in functions.php

    function ntml_remove_action_rank_math(){
    if(bp_current_component()){
    remove_action(‘template_redirect’, array( ‘Redirections’,’do_redirection’), 11);
    remove_filter(‘admin_enqueue_scripts’, array(‘Manager’,’setup’) , 5);
    remove_filter(‘wp’, array( ‘Manager’, ‘setup’), 25);
    }
    }
    add_action(‘init’,’ntml_remove_action_rank_math’);

    We are just trying to optimize our website because we have lot of database load in system already and we are remove extra stuff which is not necessary.

    thank you!!!

    Best Regards
    Himanshu Ahuja

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Thank you for getting in touch with us.

    The easiest way to disable the redirections options is to disable the redirection module at WordPress Dashboard > Rank Math > Dashboard

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi Uzair,

    We are using redirection for outer pages but we are not using in buddypress area. So, thats why we are trying to unhook the function calls responsible for redirections.

    It would be great if you can help why our remove action is not working for rank math hooks.

    Best Regards
    Himanshu Ahuja

    Alberto
    Rank Math business

    Hello,

    Let me send this thread to the devs so they can check it and maybe give you some insights.

    Looking forward to help you.

    Hello,

    The easiest way to remove the action hook from the plugin is by using the remove_all_actions function with the priority. So to remove the redirection action, you can use remove_all_actions( 'template_redirect', 11 );. Please note, this function will remove all the template_redirect hook which has priority 11.

    The other way is to remove the action from global $wp_filter. Please check the solution provided in this thread: https://wordpress.stackexchange.com/questions/304859/remove-action-from-a-plugin-class/#answer-304861

    I hope that helps.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘Trying to Optimise the Database calls’ is closed to new replies.