I want change or remove <title> tag in wordpress using wordpress plugin
for instance <title> My old title </title> => <title> New title </title>

I attempt it

function plugin_title($content){
    $content=str_replace('My old title','New title',$content); 
    return $content;
}

add_filter('wp_head','plugin_title');

// however it does not work . Any idea ?

Use the wordpress_title hook

add_filter( 'wp_title', 'custom_title', 20 );

function custom_title( $title ) {
    return str_replace('My old title', 'New title', $title); 
}