0

I'm using Google Tag Manager plugin for Wordpress and WP keeps adding CDATA to the tag manager script and it fails the site verification. Without CDATA my other simple html sites are verified.

I changed wp-includes\post-template.php line 167 to this, as per the answer I found here

$content = str_replace('<![CDATA[','',$content);
$content = str_replace(']]>','',$content);
//$content = str_replace(']]>', ']]&gt;', $content); 

But, still WP is adding CDATA to the scripts.

How can I prevent this? Is there any other method?

Community
  • 1
  • 1
Abhijith Sasikumar
  • 13,262
  • 4
  • 31
  • 45

1 Answers1

2

I had the same issue when developing one of my sites using Wordpress. For me the issue was the W3 TOTAL Cache plugin enclosing the script inside the CDATA tag. Try deactivating the plugin and clear the cache manually from WP admin dashboard.