How to remove "- {sitename}" from meta title

Hello,

How can I remove the “- {sitename}” at the end of the meta title?

Have a nice day,

I also searched for a long time and did not understand why this is not done by default, although it is logical to completely manage this from Brikcs. I added this to remove unnecessary things.

add_filter( 'document_title_parts', function( $parts ){
	unset($parts['site']);
    unset($parts['tagline']);
	return $parts;
});

And yes, I understand that the topic is old, but even in similar topics there is no answer :frowning:

But in a good way, this is a mistake that no one pays attention to :frowning: Because if in a template (post, archive home etc.) we only specify one name in the title, this means that this is what I want, and not something else.

Just to add on to @clickfusion63 's answer - this also confused me, and I now just manage all my meta titles and descriptions using the Yoast plugin. Free tier is more than enough!

Yes, you can use plugins. But in my case I need to do without them because I need to display data from old data and other meta fields.

For small sites you can use any plugin, for large sites these plugins load and pollute data resources 10 times. My 100MB database turned (due to RankMath) into 1000MB in just a few years.

1 Like