Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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: May 18 2019 using Yoast SEO 11.2.1 on WordPress 5.2
*/
add_filter('user_contactmethods', 'yoast_seo_admin_user_remove_social');
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'] );
return $contactmethods;
}
@filipecsweb

This comment has been minimized.

Copy link

commented Mar 1, 2018

I may have a better one for you:
<?php remove_filter( 'user_contactmethods', array( ! empty( $GLOBALS['wpseo_admin'] ) ? $GLOBALS['wpseo_admin'] : '', 'update_contactmethods' ), 10 );

Also, you might want to talk to the Yoast developers about adding an option in admin to disable this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.