I am really confused at this point. I can not figure it out how to rename Edit My Profile link in the admin backend.

How can that be done?


You could use the wp_before_admin_bar_render hook. You can play with code samples on the Codex page by putting them in your theme's functions.php.

First off you can try examining the object by outputting its contents with print_r(), and you'll see all the familiar items. I would probably use remove_menu helper and then add a new one with the modified link title, just to keep things clean.

add_action( 'wp_before_admin_bar_render', 'my_tweaked_admin_bar' ); 

function my_tweaked_admin_bar() {
    global $wp_admin_bar;


    $wp_admin_bar->add_menu( array(
            'id'    => 'edit-profile',
            'title' => 'Edit Zee Profile',
            'href'  => admin_url('profile.php'),

The downside of this approach is that the new item will not show up in the same spot.


If you want to alter strings from core code in the backend, a nifty way to get at 'em is by means of the gettext filter.

This filter is applied by every internationalization function, i.e. for every translatable string.

Even if your goal is renaming rather than translating, it does the trick:

function wpse94377_change_admin_ui_text( $translation, $text ) {
    if( is_admin() && 'Edit My Profile' === $text ) {
        return 'Edit My Userdata';
    return $translation;
add_filter( 'gettext', wpse94377_change_admin_ui_text, 10, 2 );

Obviously you can also return another translatable string by using
__( 'Edit My Userdata', 'your-text-domain' ) after the first return statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.