Hi @Darren_M,
Conditional visibility is purely a CSS feature, the content is visually hidden but still exists.
I’m struggling a bit to imagine your scenario here- it must be CMS driven?
Is the JSON-LD within a Rich text field within a CMS collection?
Typically you’d just delete that richtext embed when you’re not using it on a CMS item, and create that embed when you have JSON to give it. I’d need to see details of your setup if you’re arranging things differently.