Hello,
Try to use https://wordpress.org/plugins/autoptimize/ , let us know the result. What exactly validator do you use?
Regards