WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#53743 new defect (bug)

Double <title> Tag with SEO Plugins in WordPress 5.8

Reported by: katsar0v Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version:
Component: General Keywords: needs-patch reporter-feedback
Focuses: Cc:

Description

Hello,

I updated to WordPress 5.8 and am using RankMath. However I noticed there are two viewport tags as well two <title> tags. I guess the code in wp-includes/block-template.php:86-88 has something to do with it. I would very like to get rid of the second <title> tag not belonging to the seo plugin.

I am also using the Oxygen Builder (3.8.1) if that helps.

Change History (4)

#1 @jorbin
2 months ago

  • Keywords reporter-feedback added

Hi @katsar0v, Thanks for the ticket.

Is this issue reproducible with one of the default themes and with all plugins disabled? If not, then it seems like something you should report to rankmath or the plugin/theme that may be responsible.

#2 @katsar0v
2 months ago

Hello @jorbin, I decided to open this ticket because I saw on the code that WordPress enforces viewport and title which I can only remove with this snippet:

add_action('wp_head', function() {
	remove_action('wp_head', '_block_template_render_title_tag', 1);
	remove_action('wp_head', '_block_template_viewport_meta_tag', 0);
}, PHP_INT_MIN);

#3 @kafleg
2 months ago

@katsar0v Talked with the Rank Math team and they reproduce this issue with Oxygen Builder. And this issue is happening with other plugins too. Deactivate all the plugins and check as @katsar0v suggested.

Thank you

#4 @katsar0v
2 months ago

It looks for me like a general issue

$template = locate_block_template( $template, $type, $templates );

enforces wp-includes/block-template.php which by enforces the viewport and title tags.

Note: See TracTickets for help on using tickets.