Hello, I am receiving a html validator error indicating “charset element found after the first 1024 bytes”.
W3TC lazy loading or EWWW lazy loading is placing a large script in the head prior to meta charset=“UTF-8”.
I tried adding the code below to functions.php. It adds the meta charset in the correct location, however it creates a duplicate.
What would be the correct code to place the existing meta charset=“UTF-8” to the top of head?
add_action('wp_head', 'add_header_code', -100);
function add_header_code(){
?>
meta charset="UTF-8"
<?php
};