From https://github.com/senlin/Code-Snippets/blob/master/Functions/Admin-Dashboard/remove-wordpress-seo-stuff.php