- Joined
- Feb 23, 2021
- Messages
- 54
- Likes
- 34
- Degree
- 0
---After having an article medically reviewed, I'm trying to implement custom schema on top of yoast's standard option. From what I've read under the FAQ section here, you're able to reference other graph pieces as a main entity or dedupe the schema by referencing the id.
I've tried both, but with no luck validating it.
So as of now, I have two medical web pages when validating the schema and to be entirely honest, I'm fairly unfamiliar with JSON.
Basically I'm not sure how to implement mainEntityOfPage, reference, or connect the two since Yoast won't let me disable schema per post.
Is it okay to have two medical web page schemas? Or what's the best way to reference my schema as the main entity or dedupe?
Here's what I have so far if that helps:
Code:<script type="application/ld+json"> {"@context":"https://schema.org", "publisher":{"@type":"Organization", "name":"NAME OF BRAND", "logo":{ "@type":"ImageObject", "url":"https://MYSITE.COM/LOGO/}}, "@type":"MedicalWebPage", "headline":"A CATCHY YET AUTHORATATIVE HEADLINE", "description":"META DESCRIPTION HERE", "author":{"@type":"Person", "name":"NAME OF AUTHOR"}, "lastReviewed":"2023-02-15T10:30:24Z", "url":"https://MYSITE.COM/THE-ARTICLE-THAT-WAS-MEDICALLY-REVIEWED/", "dateModified":"2023-02-15T10:30:24Z", "reviewedBy":{"@type":"Person", "name": "Dr. SO AND SO, MD", "sameAs" : ["https://SOCIALPROFILE1/", "https://DOCTORPROFILE2/", "https://SOCIALPROFILE3/", "https://MYSITE.COM/MEDICALLY-REVIEWED-PAGE-OF-DR-SO-AND-SO"]}} </script>
**ALL CAPS SIGNIFY PERSONAL INDENTIFIABLE INFORMATION**
I asked chatbot and apparently I was listing the main entity in the wrong place. This validates but I'm still unsure if this is the best route.
I.e. maybe removing or disabling a graph piece is better so there's not multiple types of schema. I'm going to reference mainentityofpage for now, but interested to hear if there's a better way, or which way is the best.
--
Here's what chatbot said:
It's generally not recommended to have two conflicting schema types on the same page, as it can confuse search engines and affect your site's SEO performance. Therefore, it's important to ensure that you have only one primary schema type per page.
To reference your custom schema as the main entity, you can use the mainEntityOfPage property. This property specifies the main entity of the page, which can be any schema.org type, including your custom schema. In your case, you can modify your script to include the mainEntityOfPage property as follows:
Code:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "Page Title",
"url": "https://example.com/page",
"mainEntityOfPage": {
"@type": "MedicalWebPage",
"publisher": {
"@type": "Organization",
"name": "NAME OF BRAND",
"logo": {
"@type": "ImageObject",
"url": "https://MYSITE.COM/LOGO/"
}
},
"headline": "A CATCHY YET AUTHORATATIVE HEADLINE",
"description": "META DESCRIPTION HERE",
"author": {
"@type": "Person",
"name": "NAME OF AUTHOR"
},
"lastReviewed": "2023-02-15T10:30:24Z",
"url": "https://MYSITE.COM/THE-ARTICLE-THAT-WAS-MEDICALLY-REVIEWED/",
"dateModified": "2023-02-15T10:30:24Z",
"reviewedBy": {
"@type": "Person",
"name": "Dr. SO AND SO, MD",
"sameAs": [
"https://SOCIALPROFILE1/",
"https://DOCTORPROFILE2/",
"https://SOCIALPROFILE3/",
"https://MYSITE.COM/MEDICALLY-REVIEWED-PAGE-OF-DR-SO-AND-SO"
]
}
}
}
</script>
Note that I've wrapped your existing script inside the mainEntityOfPage property, and changed the top-level @type to "WebPage" to indicate that this is the main schema type for the page.
This tells search engines that the primary content of the page is a MedicalWebPage, which is defined by your custom schema.
Regarding deduplication, you can use the @id property to assign a unique identifier to your schema, and then use that identifier to reference it in other schema types on the same page. However, I don't see any duplicate schema in the code you provided, so it shouldn't be an issue in this case.
Once you've made these changes, you can test your schema using the Google Rich Results Test tool (https://search.google.com/test/rich-results). This tool will show you any errors or warnings with your schema, which you can then fix.