Tắt update Yoast SEO

Trong một vài trường hợp, các bạn muốn tắt việc update Yoast SEO cho một số mục đích cá nhân (có những phiên bản ổn định chẳng hạn) thì làm thế nào?

Chỉ cần mở file function.php của theme đang sử dụng và chèn thêm đoạn code này vào

add_action('admin_init', 'wpc_disable_yoast_notifications');
function wpc_disable_yoast_notifications() {
  if (is_plugin_active('wordpress-seo/wp-seo.php')) {
    remove_action('admin_notices', array(Yoast_Notification_Center::get(), 'display_notifications'));
    remove_action('all_admin_notices', array(Yoast_Notification_Center::get(), 'display_notifications'));
  }
}
//No Follow extenal link
add_filter('the_content', 'my_nofollow');
add_filter('the_excerpt', 'my_nofollow');
 
function my_nofollow($content) {
    return preg_replace_callback('/<a[^>]+/', 'my_nofollow_callback', $content);
}
 
function my_nofollow_callback($matches) {
    $link = $matches[0];
    $site_link = get_bloginfo('url');
 
    if (strpos($link, 'rel') === false) {
        $link = preg_replace("%(href=\S(?!$site_link))%i", 'rel="nofollow" $1', $link);
    } elseif (preg_match("%href=\S(?!$site_link)%i", $link)) {
        $link = preg_replace('/rel=\S(?!nofollow)\S*/i', 'rel="nofollow"', $link);
    }
    return $link;
}