I would like to replace the WordPress
word in title of Dashboard.
Original title:
Dashboard < Site Title - WordPress
Expected result:
Dashboard < Site Title - foobar
I tried to do this with this below code, but it doesn't do what I expected.
add_filter('admin_title', 'my_admin_title', 10, 2);
function my_admin_title($admin_title, $title)
{
return get_bloginfo('name').' • '.$title;
}
I would like to replace the WordPress
word in title of Dashboard.
Original title:
Dashboard < Site Title - WordPress
Expected result:
Dashboard < Site Title - foobar
I tried to do this with this below code, but it doesn't do what I expected.
add_filter('admin_title', 'my_admin_title', 10, 2);
function my_admin_title($admin_title, $title)
{
return get_bloginfo('name').' • '.$title;
}
Share
Improve this question
asked Nov 16, 2019 at 9:50
FerimanFeriman
2892 silver badges9 bronze badges
2 Answers
Reset to default 2You've tried correct filter - just needs to update return:
function my_admin_title ( $admin_title, $title ) {
return $title . ' ‹ ' . get_bloginfo( 'name' ) . ' — ' . 'foobar';
}
add_filter( 'admin_title', 'my_admin_title', 10, 2 );
Btw, filter above works only for logged pages, for login page needs to add another filter:
add_filter( 'login_title', 'my_admin_title', 10, 2 );
If you're talking about this area
!Wordpress Title]1
/wp-admin/options-general.php
You should not have to insert in PHP