Wordfence Bot JS causing validation errors
-
WordFence adds the javascript below when bots check the site. The issue is that this script now causes errors/warnings on all the code validation sites when checking HTML5. The issue is that
type="text/javascriptis no longer needed and is considered an invalid attribute.Is there a filter or method in which I can remove the type attribute from the script tag?
<script type="text/javascript">↩ (function(url){↩ if(/(?:Chrome\/26\.0\.1410\.63 Safari\/537\.31|WordfenceTestMonBot)/.test(navigator.userAgent)){ return; }↩ var addEvent = function(evt, handler) {↩ if (window.addEventListener) {↩ document.addEventListener(evt, handler, false);↩ } else if (window.attachEvent) {↩ document.attachEvent('on' + evt, handler);↩ }↩ };↩ var removeEvent = function(evt, handler) {↩ if (window.removeEventListener) {↩ document.removeEventListener(evt, handler, false);↩ } else if (window.detachEvent) {↩ document.detachEvent('on' + evt, handler);↩ }↩ };↩ var evts = 'contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop keydown keypress keyup mousedown mousemove mouseout mouseover mouseup mousewheel scroll'.split(' ');↩ var logHuman = function() {↩ if (window.wfLogHumanRan) { return; }↩ window.wfLogHumanRan = true;↩ var wfscr = document.createElement('script');↩ wfscr.type = 'text/javascript';↩ wfscr.async = true;↩ wfscr.src = url + '&r=' + Math.random();↩ (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(wfscr);↩ for (var i = 0; i < evts.length; i++) {↩ removeEvent(evts[i], logHuman);↩ }↩ };↩ for (var i = 0; i < evts.length; i++) {↩ addEvent(evts[i], logHuman);↩ }↩ })('//www.cwdgservices.com/?wordfence_lh=1&hid=D0BE414EEAD6F006FED4068FEC5077F8');↩ </script>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Wordfence Bot JS causing validation errors’ is closed to new replies.