I'm a beginner in WP development, so maybe I'm missing something obvious.

Is there a way to prevent wp_head from outputting self-closing tags?

Here are two example lines taken from my website:

<meta name='robots' content='max-image-preview:large, max-snippet:-1, max-video-preview:-1' />↩
<link rel='stylesheet' id='underboot-style-css'  href='https://example.com/wp-content/themes/underboot-child/style.css?ver=6.0.2' media='all' />↩

This triggers a warning in the W3 Validator:

Self-closing tag syntax in text/html documents is widely discouraged; it’s unnecessary and interacts badly with other HTML etc.

Not exactly a deal breaker but I'd really like to have clean, valid HTML code.

Thank you for any tips!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.