enumsschema.orgjson-ldstructured-data

Specifying medicalSpecialty in Schema.org for MedicalWebPage


I'm building a medical webpage and I'm trying to build out the page schema.

Here's what I have right now:

<script type="application/ld+json">
    {
    "@type":"MedicalWebPage",
    "audience":{
        "@type":"Patient",
        "@context":"https://schema.org"
    },
    "specialty":{
        "@type":"MedicalSpecialty",
        "@context":"https://schema.org"
    },
    "@context":"https://schema.org",
    "@id":"#/MedicalWebPage"
    }
</script>

However, each page has a specific medical specialty like cardiovascular or midwifery, but I can't figure out how to do that. I've tried the following, but I get errors:

    "specialty":{
        "@type":"MedicalSpecialty",
        "@context":"https://schema.org",
        "content":"Cardiovascular",
    },


    "specialty":{
        "@type":"Cardiovascular",
        "@context":"https://schema.org"
    },


    "medicalSpecialty":{
        "@type":"Cardiovascular",
        "@context":"https://schema.org"
    },


    "specialty":{
        "@type":"MedicalSpecialty :: Cardiovascular",
        "@context":"https://schema.org"
    },


    "specialty":{
        "@type":"MedicalSpecialty > Cardiovascular",
        "@context":"https://schema.org"
    },

The following works, but I'm not sure if I'm going to get the same SEO benefit as what I'm hoping to accomplish:

    "specialty":"https://schema.org/Cardiovascular",

Thanks!


Solution

  • As of this writing it appears this area of schema.org is still not really flushed out enough for there to be a solidified answer. There's also a few moving pieces to your question:

    Validation and correct markup

    This one is a bit of a rabbit hole. From what I've looked up, everything seems to imply that MedicalSpeciality should be related to Hospital, MedicalOrganization, Physician, or MedicalClinic. You can see that listed on https://schema.org/MedicalSpecialty itself. This led me to believe MedicalSpeciality is really best applied to those vs. being applied to MedicalWebPage.

    Having said that - MedicalSpeciality is a subset of Specialty which can be applied to WebPage / MedicalWebPage.

    I think you were initially on the right track and here is the modification I made. This code validates in the Structured Data Testing Tool:

    <script type="application/ld+json">
        {
        "@type":"MedicalWebPage",
        "audience":{
            "@type":"Patient",
            "@context":"https://schema.org"
        },
        "specialty":{
            "@type":"MedicalSpecialty",
            "@context":"https://schema.org",
            "name":"Cardiovascular"
        },
        "@context":"https://schema.org",
        "@id":"#/MedicalWebPage"
        }
    </script>
    

    Of course, name can be anything and doesn't specifically tie it to Cardiovascular from Schema - so not exactly what you'd want. Also while it validates in the Structured Data Testing Tool, Google also came out with the new Rich Snippets Results tool which is supposed to be the replacement (but in my opinion is really lacking - I've had no success testing snippets there).

    I'd be open to see more concrete/official examples but as you've probably seen from https://schema.org there really isn't any.

    That leads me to this next section and why I started my answer off the way I did..

    Search engine benefits

    I discovered this GitGub thread from a few months ago (as of this writing), written by a contributor to schema.org on the topic of MedicalSpecialty. I think this pretty clearly states that even schema.org themselves haven't really flushed out a final solution to how medical structured data should be mapped.

    On top of schema.org still needing to flush out the details - there is then the completely separate issue of Google and other search engines implementing it. Based on that GitHub thread it looks like there will be more to come in the future but I'd be hesitant to put much weight into at the moment (this part is just my opinion). Typically when it comes to structured data and Google, I usually assume it's main benefits are only going to come from what they officially support and anything else will have light impact at best.

    Also - While I think asking how to implement structured data from a code perspective fits here, this is really teetering on the edge of being an SEO specific question which is considered off-topic on SO generally. I'd suggest asking more SEO related questions around schema.org over at https://webmasters.stackexchange.com/