Site logo

Archived topic

html errors

5 replies · Started by Matt on April 5, 2022

Viewing posts 1–6 of 6

All my pages get errors when running through html validator (https://validator.w3.org/)

The errors all point to this

Example page.
https://activedirectorypro.com/change-ip-address-on-domain-controller/

<style>.wp-container-624c3c6a6f535 {display: flex;gap: 0.5em;flex-wrap: wrap;align-items: center;align-items: center;}.wp-container-624c3c6a6f535 > * { margin: 0; }</style>
<style>.wp-container-624c3c6a708de .alignleft { float: left; margin-right: 2em; }.wp-container-624c3c6a708de .alignright { float: right; margin-left: 2em; }</style>
<style>.wp-container-624c3c6a70d1d .alignleft { float: left; margin-right: 2em; }.wp-container-624c3c6a70d1d .alignright { float: right; margin-left: 2em; }</style>
<style>.wp-container-624c3c6a71359 {display: flex;gap: 0.5em;flex-wrap: wrap;align-items: center;align-items: center;}.wp-container-624c3c6a71359 > * { margin: 0; }</style>

How can I fix the errors or what is putting this code here.

Hi there,

those styles are dynamically output by WP Core - any core block that has a 'container' now seems to generate them.
The only gitissue i could find, looking for way to 'filter' them was this one:

https://github.com/WordPress/gutenberg/issues/36135

And it looks like there is no filter to remove them.

Options:
1. Don't use core blocks - on your site you're using the Group block in widget areas, and the Social Icons blocks which are responsible for that CSS.
You could swap them out for GenerateBlocks Container and Buttons Block.

2. Nag the hell out of WordPress in a hope they may change their approach to inline dynamic styles being loaded in the foot.

3. Ignore the errors

Thanks. I'll try try the generateblocks

You're welcome

I removed all footer widgets and still have one error.

<style>.wp-container-624c4a0385642 {display: flex;gap: 0.5em;flex-wrap: wrap;align-items: center;align-items: center;}.wp-container-624c4a0385642 > * { margin: 0; }</style>

Looks like the Social Icons Block in the Sidebar.

This archived topic is closed to new replies.