Ok, here is a little more information about my trouble :
In fact, i had 2 schema scripts, one from my rating pluging and the other from the AMP plugin.
I have removed the structured data of the AMP plugin because it was not complete so i’m now with the structured data of the rating plugin but still can’t found how to remove the annoying tag <!CDATA[“”].
I hope someone can help me out with that.
ps: sorry for my bad English 🙁
Fixed In The Next Version
Hi @ulissse,
Thanks for raising this, and we’ve also seen this issue 🙂
There’s a fix for this in the upcoming 0.7 release:
https://github.com/Automattic/amp-wp/tree/0.7
It’s now in Beta, and we’d appreciate you testing it if you can. But it’s not yet ready for a production site.
Here’s the pull request that fixed the issue:
https://github.com/Automattic/amp-wp/pull/891
Thanks!
That’s great to hear, thank you, but in the meantime of the new release of the plugin is there a way to remove this CDATA ?
For exemple by adding something like this on the right place :
$string = str_replace(‘<![CDATA[‘,”,$string);
$string = str_replace(‘]]>’,”,$string);
Thank you.
You could try something like this:
add_filter( 'amp_post_template_data', function( $data ) {
$data['post_amp_content'] = str_replace( '<![CDATA[', '', $data['post_amp_content'] );
$data['post_amp_content'] = str_replace( ']]>', '', $data['post_amp_content'] );
return $data;
} );
This is working great!
Thank’s a lot, i have all my problems solved.
Thanks again for you great work !
Thanks! By the way, there haven’t been a lot of plugin ratings submitted to coincide with the recent improvements to the plugin. If you wouldn’t mind adding a review that would be helpful: https://wordpress.org/support/plugin/amp/reviews/#new-post