-
Hello,
my website is a mix of wordpress and native php pages. To maintain the same design on all pages, I’m using the WP header and -footer in the code of the native php pages. Here comes my problem: If I use the wordpress header then I also get the RankMath meta tags. I don’t need them on these pages and want to disable the RankMath plugin for them.
Is there any filter for the functions.php to disable RankMath fo certain pages?
//Disable YOAST for non WP pages add_action('template_redirect','remove_wpseo'); function remove_wpseo(){ if (get_post_type() == "") { global $wpseo_front; if(defined($wpseo_front)){ remove_action('wp_head',array($wpseo_front,'head'),1); } else { $wp_thing = WPSEO_Frontend::get_instance(); remove_action('wp_head',array($wp_thing,'head'),1); } } }
Are you offering a similar code snippet?
Thanks a lot, Bernd
PS: I need this, because RankMath adds noindex meta tags to all unknown post types (like YOAST)
The ticket ‘Disable RankMath in functions.php’ is closed to new replies.