Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save damienvancouver/0d6d6788064b227f6a968ca93172d6fe to your computer and use it in GitHub Desktop.
Save damienvancouver/0d6d6788064b227f6a968ca93172d6fe to your computer and use it in GitHub Desktop.
Remove Yoast SEO Social Profiles From All Users
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Social Profiles From All Users
* Credit: Yoast Developers
* Last Tested: Dec 8th, 2021 using Yoast SEO Premium 17.6 on WordPress 5.8.2
*/
add_filter('user_contactmethods', 'yoast_seo_admin_user_remove_social', 99);
/**
* Remove annoying Yoast social fields from user profile forms.
* @see https://gist.github.com/amboutwe/36a08f9d369860aec99500726065bd3f
*/
public function yoast_seo_admin_user_remove_social($contactmethods)
{
// we want none of them, remove them all by returning
// an empty array.
$contactmethods = array();
// or... remove one at a time... and return the modified $contactmethods
//unset($contactmethods['facebook']);
//unset($contactmethods['instagram']);
//unset($contactmethods['linkedin']);
//unset($contactmethods['myspace']);
//unset($contactmethods['pinterest']);
//unset($contactmethods['soundcloud']);
//unset($contactmethods['tumblr']);
//unset($contactmethods['twitter']);
//unset($contactmethods['youtube']);
//unset($contactmethods['wikipedia']);
//unset($contactmethods['author_email']);
//unset($contactmethods['author_facebook']);
//unset($contactmethods['author_twitter']);
//unset($contactmethods['author_linkedin']);
//unset($contactmethods['author_dribble']);
//unset($contactmethods['author_whatsapp']);
//unset($contactmethods['author_custom']);
return $contactmethods;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment