i'm using wordpress 4.6 i'd like to remove just the title tag automatically outputted by wordpress because need to hardcode the html title tag in the template.

i guess is something like this:

add_action('wp_head', '//remove title tag command');

but i didn't find any valid solution so far.


You can see everything added to wp_head in the file /wp-includes/default-filters.php.

If your theme supports the title tag, you can remove it entirely with remove_action:

remove_action( 'wp_head', '_wp_render_title_tag', 1 );

Though it may be simpler/better to use remove_theme_support( 'title-tag' ) in a child theme, which is what _wp_render_title_tag checks before outputting the title tag.


Wordpress 5.7.1 with Yoast SEO installed Working code is:

add_filter('document_title_parts', '__return_empty_array', 10);

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.