Can’t change the title tag with wp_title filter
When adding title-tag support in a theme, the title tag can be filtered by several filters, but not wp_title. The reason is that if the theme supports title-tag, WordPress uses wp_get_document_title() instead of wp_title(). For themes with support for title-tag you can use document_title_parts: add_filter( ‘document_title_parts’, ‘filter_document_title_parts’ ); function filter_document_title_parts( $title_parts ) { $title_parts[‘title’] = … Read more