How to disable Yoast on specific pages? Was fine before v14
-
I’ve just updated to 14.0.1 (from 13.5) and suddenly the code I was using (in functions.php) to disable Yoast on specific pages, is no longer working.
This is the code that was working fine (it disables Yoast’s output on the homepage) until v14, so I’m guessing that either the $wpseo_front or WPSEO_Frontend code/variable name has changed in v14:
add_action('template_redirect','remove_wpseo'); function remove_wpseo(){ if (is_front_page()) { 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); } } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to disable Yoast on specific pages? Was fine before v14’ is closed to new replies.