Cómo eliminar la biografía de la página de administración del perfil de usuario
Me gustaría eliminar u ocultar el campo de entrada de Biografía de la página de perfil. ¿Cómo se hace esto? Ya eliminé algunos métodos de contacto de esta página, pero no estoy seguro de cómo deshacerme de la biografía.

No hay un gancho dedicado – la gestión de usuarios es una prioridad baja en WordPress. Tienes que usar el buffer de salida (sí, no es lo ideal).
Aquí hay una demostración simple de cómo se podría hacer:
add_action( 'personal_options', array ( 'T5_Hide_Profile_Bio_Box', 'start' ) );
/**
* Captura la parte con la biobox en un buffer de salida y la elimina.
*/
class T5_Hide_Profile_Bio_Box
{
/**
* Se ejecuta en 'personal_options'.
*
* @return void
*/
public static function start()
{
$action = ( IS_PROFILE_PAGE ? 'show' : 'edit' ) . '_user_profile';
add_action( $action, array ( __CLASS__, 'stop' ) );
ob_start();
}
/**
* Elimina la caja de biografía del contenido almacenado en el buffer.
*
* @return void
*/
public static function stop()
{
$html = ob_get_contents();
ob_end_clean();
// elimina el encabezado
$headline = __( IS_PROFILE_PAGE ? 'About Yourself' : 'About the user' );
$html = str_replace( '<h2>' . $headline . '</h2>', '', $html );
// elimina la fila de la tabla
$html = preg_replace( '~<tr>\s*<th><label for="description".*</tr>~imsUu', '', $html );
print $html;
}
}
Puedes descargar el código como un plugin independiente: Plugin Remove Bio Box.
Los campos de contraseña ahora están bajo Información de contacto... si no te gusta, añade un encabezado en stop()
– y ten en cuenta la internacionalización (I18n). ;)

Desde el reciente cambio de clase esto funciona:
add_action( 'personal_options', array ( 'T5_Hide_Profile_Bio_Box', 'start' ) );
/**
* Captura la parte con la biobox en un buffer de salida y la elimina.
*
* @author Thomas Scholz, <info@toscho.de>
*
*/
class T5_Hide_Profile_Bio_Box
{
/**
* Llamado en 'personal_options'.
*
* @return void
*/
public static function start()
{
$action = ( IS_PROFILE_PAGE ? 'show' : 'edit' ) . '_user_profile';
add_action( $action, array ( __CLASS__, 'stop' ) );
ob_start();
}
/**
* Elimina la caja de biografía del contenido almacenado en el buffer.
*
* @return void
*/
public static function stop()
{
$html = ob_get_contents();
ob_end_clean();
// remueve el encabezado
$headline = __( IS_PROFILE_PAGE ? 'Acerca de ti' : 'Acerca del usuario' );
$html = str_replace( '<h3>' . $headline . '</h3>', '', $html );
// remueve la fila de la tabla
$html = preg_replace( '~<tr class="user-description-wrap">\s*<th><label for="description".*</tr>~imsUu', '', $html );
print $html;
}
}

Sugiero cambiar esto $headline = __( IS_PROFILE_PAGE ? 'About Yourself' : 'About the user' )
por esto $headline = ( IS_PROFILE_PAGE ? __('About Yourself') : __('About the user' ));

Basándome en las respuestas anteriores, aquí está lo que estoy usando para eliminar las partes de la página de Usuario que no deseo:
$pagesToAffect = [
'/wp-admin/user-edit.php',
'/wp-admin/profile.php'
];
if (isset($PHP_SELF) && in_array($PHP_SELF, $pagesToAffect)) {
add_action('admin_head', [UserProfileCleaner::class, 'start']);
add_action('admin_footer', [UserProfileCleaner::class, 'finish']);
add_filter('user_contactmethods',[UserProfileCleaner::class, 'hideInstantMessaging'],10000,1);
}
class UserProfileCleaner {
public static function start() {
ob_start(function($buffer) {
// Opciones Personales
if (!IS_PROFILE_PAGE) {
$startHeading = 'Opciones Personales';
$pattern = "@<(h[0-9]) ?[^>]*?>".preg_quote(_x($startHeading))."</\\1 ?>@is";
preg_match($pattern, $buffer, $start, PREG_OFFSET_CAPTURE);
$endHeading = 'Nombre';
$pattern = "@<(h[0-9]) ?[^>]*?>".preg_quote(_x($endHeading))."</\\1 ?>@is";
preg_match($pattern, $buffer, $end, PREG_OFFSET_CAPTURE);
if (isset($start[0][1]) && isset($end[0][1]) && $start[0][1]<$end[0][1]) {
$buffer = substr($buffer, 0, $start[0][1]).substr($buffer,$end[0][1]);
}
}
$buffer = self::removeSectionHeading($buffer, 'Nombre');
$buffer = self::removeSectionHeading($buffer, 'Información de Contacto');
$buffer = self::removeSectionHeading($buffer, 'Capacidades Adicionales');
$buffer = self::removeSectionRow($buffer, 'Capacidades');
$buffer = self::removeSectionHeading($buffer, 'Foros');
// Acerca de / Biografía
$heading = IS_PROFILE_PAGE ? 'Acerca de ti' : 'Acerca del usuario';
$buffer = self::removeStandardSection($buffer, $heading);
// Yoast
$heading = 'Configuración de Yoast SEO';
$buffer = self::removeStandardSection($buffer, $heading);
$heading = 'Membresías';
$pattern = "@<(h[0-9]) ?[^>]*?>".preg_quote(_x($heading))."</\\1 ?>.*?</p>@is";
$buffer = preg_replace($pattern, "", $buffer, 1);
return $buffer;
});
}
private static function removeStandardSection($buffer, $heading) {
$pattern = "@<(h[0-9]) ?[^>]*?>".preg_quote(_x($heading))."</\\1 ?>.*?</table>@is";
return preg_replace($pattern, "", $buffer, 1);
}
private static function removeSectionHeading($buffer, $heading) {
$pattern = "@<(h[0-9]) ?[^>]*?>".preg_quote(_x($heading))."</\\1 ?>@is";
return preg_replace($pattern, "", $buffer, 1);
}
function removeSectionRow($buffer, $heading) {
$pattern = "@<tr ?[^>]*?>[^<]*?<th ?[^>]*?>[^<]*?".preg_quote(_x($heading))."[^<]*?</th ?[^>]*?>.*?</tr ?>@is";
return preg_replace($pattern, "", $buffer, 1);
}
public static function finish() {
ob_end_flush();
}
public static function hideInstantMessaging( $contactmethods ) {
unset($contactmethods['googleplus']);
unset($contactmethods['twitter']);
unset($contactmethods['facebook']);
return $contactmethods;
}
}
Todavía depende de la estructura del HTML, pero funciona para mí.

¿Cómo puedo eliminar el sitio web de user-new.php? Añadí la página a $pagesToAffect y eliminé el sitio web como una fila, pero todavía aparece.

Si agregas el siguiente código a tu archivo functions.php, eliminará la sección de biografía para todos los idiomas de un sitio multilingüe:
//eliminar la biografía
function remove_plain_bio($buffer) {
$titles = array('#<h3>'._x('Sobre ti', 'Título de sección de perfil').'</h3>#','#<h3>'._x('Sobre el usuario', 'Título de sección de perfil').'</h3>#');
$buffer=preg_replace($titles,'<h3>'._x('Contraseña', 'Título de sección de perfil').'</h3>',$buffer,1);
$biotable='#<h3>'._x('Contraseña', 'Título de sección de perfil').'</h3>.+?<table.+?/tr>#s';
$buffer=preg_replace($biotable,'<h3>'._x('Contraseña', 'Título de sección de perfil').'</h3> <table class="form-table">',$buffer,1);
return $buffer;
}
function profile_admin_buffer_start() { ob_start("remove_plain_bio"); }
function profile_admin_buffer_end() { ob_end_flush(); }
add_action('admin_head', 'profile_admin_buffer_start');
add_action('admin_footer', 'profile_admin_buffer_end');
