/** * On deactivation, flush the rewrite rules so XML sitemaps stop working. */ function wpseo_deactivate() { require_once WPSEO_PATH . 'inc/wpseo-functions.php'; flush_rewrite_rules(); wpseo_remove_capabilities(); // Force unschedule WPSEO_Options::schedule_yoast_tracking(null, get_option('wpseo'), true); // Clear cache so the changes are obvious. WPSEO_Options::clear_cache(); do_action('wpseo_deactivate'); }