1

The <title> tag in pages for post edit is Edit Post < Site name — WordPress. I want to change it to Edit Post < Site name – The title of the post in editing. Is this possible? Where can I locate the header of this page? Apparently it cannot be in the theme.

enter image description here

1

Add this code instead on your functions.php, this will change the post and product title to the post or product that is being edit:

add_filter('admin_title', 'my_admin_title', 10, 2);
function my_admin_title($admin_title, $title)
{
        global $post, $action;
        if ( isset($post->post_title) and $action == 'edit' ){
        return 'Edit < '.$post->post_title.' - '.get_bloginfo('name');
        } else {
            return $title .' - ' .get_bloginfo('name');
        }
}
1
  • This is perfect. Do you know why the code doesn't work when put it in the child theme?
    – Ooker
    Nov 30 '20 at 6:56

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.