• Resolved maxxnz

    (@maxxnz)


    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)
  • Plugin Support devnihil

    (@devnihil)

    Unfortunately we can’t offer support on custom code. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Thank you for your understanding.

    Plugin Support Jerlyn

    (@jerparx)

    Closed. No other concerns.

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.