Title: Missing &#039;CDATA&#039; Comments
Last modified: August 30, 2016

---

# Missing 'CDATA' Comments

 *  [Terry Lin 01](https://wordpress.org/support/users/terry-lin-01/)
 * (@terry-lin-01)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/missing-cdata-comments/)
 * Hi Guys,
 * I meet the Missing ‘CDATA’ Comments problem, when google tags installed in page.
   Someone gave guides here. [http://simon.xn--schnbeck-p4a.dk/wordpress-cdata-nightmare/](http://simon.xn--schnbeck-p4a.dk/wordpress-cdata-nightmare/),
   but I still don’t know what to do.
 * Please help me how to commented out:
    $content = str_replace(‘]]>’, ‘]]>’, $content);
   in /wp-includes/post-template.php.
 * Thanks a lot in advance.
 * Terry

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Thread Starter [Terry Lin 01](https://wordpress.org/support/users/terry-lin-01/)
 * (@terry-lin-01)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6449618)
 * I am new to WP and not code savvy /:
 *  Thread Starter [Terry Lin 01](https://wordpress.org/support/users/terry-lin-01/)
 * (@terry-lin-01)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6449773)
 * Please help /:
 *  Thread Starter [Terry Lin 01](https://wordpress.org/support/users/terry-lin-01/)
 * (@terry-lin-01)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6449822)
 * Please, no one help me, bros and sisters /:
 *  [S1awek](https://wordpress.org/support/users/s1awek/)
 * (@s1awek)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6449975)
 * If you still didn’t find the answer this is it:
    go to `/wp-includes/`**`post-
   template.php`** in your WordPress instalation.
 * Go to line 231 of `post-template.php` and change:
 * > $content = str_replace( ‘]]>’, ‘]]>’, $content );
 * to
 * > /* $content = str_replace( ‘]]>’, ‘]]>’, $content ); */
 * That is it, at least to the next WordPress update, then you might have to do 
   it again.
 *  [LogoLogics](https://wordpress.org/support/users/logologics/)
 * (@logologics)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450003)
 * Thanks S1awek,
 * That works like a charme!
    However not very good for workflow if this needs to
   be done over and over again after every core update.
 * I there a way to maybe copy that post-tamplate.php into the child themes folder
   so the modification stays intact like with the function.php, style sheet customizations,
   footer.php etc?
 * Any idea’s if and how to make that happen?
 * Thanks,
    Annie
 *  [S1awek](https://wordpress.org/support/users/s1awek/)
 * (@s1awek)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450004)
 * I’m happy that I could help.
    I think that keeping core WP files out of date 
   is not a good idea for security and compatibility reasons. You can change it 
   manually after every update, or get a script which will do that for you. If you
   don’t know how to create such a script just hire freelancer, try at fiver.com
   Cheers
 *  [LogoLogics](https://wordpress.org/support/users/logologics/)
 * (@logologics)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450005)
 * Hi S1awek,
 * I found a snippet that does this and have implemented an tested it succesfully.
   I will share it here, it might help someone else.
 * [http://businessbloomer.com/woocommerce-add-conversion-tracking-code-thank-page/](http://businessbloomer.com/woocommerce-add-conversion-tracking-code-thank-page/)
 * Basically you need to add this code snippet ( ofcourse replace it with the specific
   conversion code needed ) into the child themes functions.php:
 * /**
    * [@snippet](https://wordpress.org/support/users/snippet/) Add Conversion
   Tracking Code to Thank You Page * [@how-to](https://wordpress.org/support/users/how-to/)
   Watch tutorial @ [http://businessbloomer.com/?p=19055](http://businessbloomer.com/?p=19055)*
   [@sourcecode](https://wordpress.org/support/users/sourcecode/) [http://businessbloomer.com/?p=19964](http://businessbloomer.com/?p=19964)*
   [@author](https://wordpress.org/support/users/author/) Rodolfo Melogli * @testedwith
   WooCommerce 2.5.2 */
 * add_action( ‘woocommerce_thankyou’, ‘bbloomer_conversion_tracking’ );
 * function bbloomer_conversion_tracking() {
    ?> <!– Google Code for Conversion 
   Page –> <script type=”text/javascript”> /* <![CDATA[ */ var google_conversion_id
   = 000000000000; var google_conversion_language = “en”; var google_conversion_format
   = “3”; var google_conversion_color = “ffffff”; var google_conversion_label = “
   kjsdhfkjhkfsdfsdf”; var google_remarketing_only = false; /* ]]> */ </script> 
   <script type=”text/javascript” src=”//www.googleadservices.com/pagead/conversion.
   js”> </script> <noscript> <div style=”display:inline;”> <img height=”1″ width
   =”1″ style=”border-style:none;” alt=”” src=”//www.googleadservices.com/pagead/
   conversion/000000000000/?label=kjdhfsdjfkjkjshdkkkjsdkk&guid=ON&script=0″/> </
   div> </noscript> <?php }
 * After ofcourse saving the functions.php the conversion code will work on the 
   default Woocommerce thank you page ( my account end point ) where a costumers
   lands on after closing an order or purchase in Woocommerce checkout. This works
   great, without the need of altering the code in the wp core files and the need
   to do this over and over again.
 * I still appreaciate your help, it does work like a charme, but this one has no
   need to alter after updates.
 * Hope this helps someone else too!
 * Thanks a lot,
    Annie
 *  [Johnny Sea](https://wordpress.org/support/users/lanceryanriley/)
 * (@lanceryanriley)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450011)
 * I made the change that S1awek suggested, but still seeing the CDATA error with
   the tag assistant.
 * Is there something else I’m missing?
 *  [LogoLogics](https://wordpress.org/support/users/logologics/)
 * (@logologics)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450012)
 * Hi Johnny,
 * Did you by any chance forget to save the /wp-includes/post-template.php after
   making those changes?
 * Did you recently upgrade to WP 4.5 and is that file overwritten?
 *  [LogoLogics](https://wordpress.org/support/users/logologics/)
 * (@logologics)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450013)
 * Oh, and do you have some caching plugin going on? Did you flush the cache, clear
   the browsers cache?

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Missing 'CDATA' Comments’ is closed to new replies.

## Tags

 * [cdata](https://wordpress.org/support/topic-tag/cdata/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 4 participants
 * Last reply from: [LogoLogics](https://wordpress.org/support/users/logologics/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/missing-cdata-comments/#post-6450013)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
