Advertisement
mbis

Stop RankMath redirect after Permalink Manager detects URI

May 24th, 2021
1,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. add_action('wp', function() {
  2.     global $wp_query;
  3.  
  4.     if(!is_admin() && !empty($wp_query->query_vars['do_not_redirect']) && function_exists('rank_math')) {
  5.         $rank_math_redirections = rank_math()->manager->get_module('redirections');
  6.         remove_action('wp', array($rank_math_redirections, 'do_redirection'), 11);
  7.     }
  8. }, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement