I need change or remove <title>
tag in wordpress using plugin
for example <title> My old title </title>
=> <title> New title </title>
I try it
function plugin_title($content){
$content=str_replace('My old title','New title',$content);
return $content;
}
add_filter('wp_head','plugin_title');
// but it doesn't work . Any idea ?
Try using the wp_title hook
add_filter( 'wp_title', 'custom_title', 20 );
function custom_title( $title ) {
return str_replace('My old title', 'New title', $title);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With