Skip to content

Instantly share code, notes, and snippets.

@amboutwe
Last active September 9, 2025 09:59
Show Gist options
  • Select an option

  • Save amboutwe/36a08f9d369860aec99500726065bd3f to your computer and use it in GitHub Desktop.

Select an option

Save amboutwe/36a08f9d369860aec99500726065bd3f to your computer and use it in GitHub Desktop.
Remove Yoast SEO Social Profiles From All Users
/* Remove Yoast SEO Social Profiles From All Users
* Credit: Yoast Developers
* Last Tested: Nov 01 2023 using Yoast SEO 21.5 on WordPress 6.3.2
*********
* Use this code to hide the fields shown under Admin > Users > Edit user
* Previously entered profiles will be included in schema
* To limit or remove user schema, use 'wpseo_schema_person_social_profiles' filter
* Link: https://developer.yoast.com/features/schema/pieces/person/#social-profiles
*/
add_filter('user_contactmethods', 'yoast_seo_admin_user_remove_social', 99);
function yoast_seo_admin_user_remove_social ( $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['mastodon'] ); // Premium feature
//Do not remove the lines below
return $contactmethods;
}
@spaceballstheuser
Copy link

This removes all of them:

add_filter('user_contactmethods', function () {
return [];
}, 99);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment