I have a schema in JSON-LD as per Schema.org. When it was inline (within <script>
tags), the Google structured data testing tool recognised the schema successfully.
If I link it externally, the structured data testing tool doesn't recognise it. For example:
<script src="json/main-schema.json" type="application/ld+json"></script>
Is this something I should be worried about?
How I had the working schema (example from Schema.org):
<script type="application/ld+json">
{ "@context" : "http://schema.org",
"@type" : "Organization",
"url" : "http://www.your-company-site.com",
"contactPoint" : [
{ "@type" : "ContactPoint",
"telephone" : "+1-401-555-1212",
"contactType" : "customer service"
} ] }
</script>
External schema layed out in main-schema.json
, linked with:
<script src="json/main-schema.json" type="application/ld+json"></script>
{ "@context" : "http://schema.org",
"@type" : "Organization",
"url" : "http://www.your-company-site.com",
"contactPoint" : [
{ "@type" : "ContactPoint",
"telephone" : "+1-401-555-1212",
"contactType" : "customer service"
} ] }
<?php include 'json.php';?>
, just a suggestion mind.<link>
not<script>
sincesrc=""
is not valid. But Google only supports script... so looks like it has to be inline.