I can only offer guesses without a URL to an affected page, but my guess is that the code you added isn’t part of the issue you’re seeing with the structured data. The plugin’s default behavior is to add the buttons to the output using the_content filter, which can sometimes result in the buttons ending up in places where you might not want them. The plugin intentionally excludes the RSS feed from the output for this reason.
What you may want to do is to move the buttons–in the code, but not visually–to a different filter or action hook which is more specific than the_content. Scriptless can do this automatically for sites using a Genesis Framework child theme, because the hooks in that framework are pretty consistent. If your theme offers filter or action hooks outside of the_content, you can change to those following this example.
I use GeneratePress theme which has some inbuilt hooks https://docs.generatepress.com/collection/hooks/ and filters https://docs.generatepress.com/collection/filters/.
This code seems to resolve the issue, but if you have a better solution, let me know. I changed to manual placement for this one.
// Scriptless social sharing buttons before content
add_action( 'generate_before_content', 'ac_custom_share_buttons');
function ac_custom_share_buttons() {
if (is_single() ) {
?>
<?php echo do_shortcode('[scriptless]'); ?>
<?php
}
}
// Scriptless social sharing buttons after content
add_action( 'generate_after_content', 'ac_custom_share_button');
function ac_custom_share_button() {
if (is_single() ) {
?>
<?php echo do_shortcode('[scriptless]'); ?>
<?php
}
}
Got a condensed solution from my theme developer.