W3C Validator Charset Error

Sometimes the W3C validator will give you this error:

Error: A charset attribute on a meta element found after the first 1024 bytes.

This can be because when certain features are active in WP Rocket, like minification and DNS Prefetch, we add code to the beginning of the <head>.

There are a couple of approaches to solving this:

A

Remove the meta charset tag from your theme

WP Rocket places the charset in the .htaccess file which is better for performance, so you don’t need it in the theme as well.

B

Move meta charset to beginning of the head

Alternatively you can install the small plugin found below which will move the meta charset tag to the start of the <head>, thereby satisfying the W3C validator.

Download the ZIP file via the link below, then install it as a plugin through your WordPress dashboard:

📥  Download: Move Meta Charset Plugin