Admin Label Renamer

Rename common WordPress admin labels to match your workflow. This plugin only changes visible labels and does not modify permissions, URLs, or post types.

'admlr_sanitize_labels', 'default' => [], ] ); add_settings_section( 'admlr_main_section', 'Rename Admin Labels', '__return_false', 'admlr_label_renamer' ); $fields = [ 'posts' => 'Posts', 'pages' => 'Pages', 'users' => 'Users', 'comments' => 'Comments', 'media' => 'Media', 'plugins' => 'Plugins', ]; foreach ( $fields as $key => $label ) { add_settings_field( "admlr_{$key}", "{$label} label", 'admlr_render_field', 'admlr_label_renamer', 'admlr_main_section', [ 'key' => $key ] ); } } /*-------------------------------------------------------------- # Render Field Callback --------------------------------------------------------------*/ function admlr_render_field( $args ) { $options = get_option( 'admlr_labels', [] ); $key = $args['key']; ?> $value ) { $output[ $key ] = sanitize_text_field( $value ); } return $output; } /*-------------------------------------------------------------- # Rename Admin Menu Labels --------------------------------------------------------------*/ add_action( 'admin_menu', 'admlr_rename_menu_labels', 999 ); function admlr_rename_menu_labels() { $options = get_option( 'admlr_labels', [] ); if ( empty( $options ) ) { return; } global $menu; foreach ( $menu as $i => $item ) { if ( $item[2] === 'edit.php' && ! empty( $options['posts'] ) ) { $menu[ $i ][0] = esc_html( $options['posts'] ); } if ( $item[2] === 'edit.php?post_type=page' && ! empty( $options['pages'] ) ) { $menu[ $i ][0] = esc_html( $options['pages'] ); } if ( $item[2] === 'users.php' && ! empty( $options['users'] ) ) { $menu[ $i ][0] = esc_html( $options['users'] ); } if ( $item[2] === 'edit-comments.php' && ! empty( $options['comments'] ) ) { $menu[ $i ][0] = esc_html( $options['comments'] ); } if ( $item[2] === 'upload.php' && ! empty( $options['media'] ) ) { $menu[ $i ][0] = esc_html( $options['media'] ); } if ( $item[2] === 'plugins.php' && ! empty( $options['plugins'] ) ) { $menu[ $i ][0] = esc_html( $options['plugins'] ); } } } /*-------------------------------------------------------------- # Rename Labels (Scoped gettext) --------------------------------------------------------------*/ add_filter( 'gettext', 'admlr_filter_gettext', 20, 3 ); function admlr_filter_gettext( $translated, $text, $domain ) { if ( ! is_admin() || $domain !== 'default' ) { return $translated; } $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( empty( $screen ) ) { return $translated; } $allowed_screens = [ 'dashboard', 'edit-post', 'edit-page', 'users', 'edit-comments', 'upload', 'plugins', ]; if ( ! in_array( $screen->base, $allowed_screens, true ) ) { return $translated; } $options = get_option( 'admlr_labels', [] ); if ( empty( $options ) ) { return $translated; } $map = [ 'Post' => $options['posts'] ?? '', 'Posts' => $options['posts'] ?? '', 'Page' => $options['pages'] ?? '', 'Pages' => $options['pages'] ?? '', 'User' => isset( $options['users'] ) ? rtrim( $options['users'], 's' ) : '', 'Users' => $options['users'] ?? '', 'Comment' => isset( $options['comments'] ) ? rtrim( $options['comments'], 's' ) : '', 'Comments' => $options['comments'] ?? '', 'Media' => $options['media'] ?? '', 'Plugin' => isset( $options['plugins'] ) ? rtrim( $options['plugins'], 's' ) : '', 'Plugins' => $options['plugins'] ?? '', ]; foreach ( $map as $from => $to ) { if ( $to ) { $translated = str_replace( $from, $to, $translated ); } } return $translated; }