Is there someway to change the title in wp-admin? Been looking all over google but no one seem to mention it.
I simply want to get rid of "— WordPress" and possibly change the "‹" into some other symbol.
Any ideas?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityadd_filter('admin_title', 'my_admin_title', 10, 2);
function my_admin_title($admin_title, $title)
{
return get_bloginfo('name').' • '.$title;
}
You could also do a str_replace
on $admin_title
to remove "— WordPress" and change "‹".
Look at the top of the wp-admin/admin-header.php
file to see what is going on by default.
Here's how we've done it, in order to change only a specific custom post type:
/* edit the admin page title for a particular custom post type */
function edit_page_title() {
global $post, $title, $action, $current_screen;
if( isset( $current_screen->post_type ) && $current_screen->post_type == 'CUSTOM-POST-TYPE' && $action == 'edit' ) {
/* this is the new page title */
$title = 'Change to whatever you want: ' . $post->post_title;
} else {
$title = $title .' - ' .get_bloginfo('name');
}
return $title;
}
add_action( 'admin_title', 'edit_page_title' )
This is more important than the basic purpose.
In fact for "edit page" the default admin_title is
get_bloginfo('name')."---Wordpress"
This is awful for who edits several pages or articles at same time. I have added the page title and the ID to avoid confusions.
Note: currently it is very difficult to find the solution if you have not the keyword "admin_title". Keywords like "Wordpress admin document title" do not give quick results. I found the current thread very far into Google (same as Wordpress search). I need four hours for an operational work of a few minutes to add a personalized filter into the child theme (functions.php)
All those answers above are unnecessarily complicated. I am a newbie and I found this out by experimentation.
$admin_title
holds the title in admin-header.php, so simply remove — Wordpress
from line 43-47 to remove "— WordPress" from the title. Play around in those lines to manipulate the title.