Max P.
Max P.

Reputation: 5679

How to add several potentialActions to WebSite in JSON-LD?

I want to add several potentialActions to WebSite in JSON-LD. My current json-ld:

  <script type="application/ld+json">
    {
       "@context":"https:\/\/schema.org",
       "type":"WebSite",
       "name":"my_name",
       "url":"my_url",
       "potentialAction":{
              "@type":"SearchAction",
              "target":"my_url/?q={query}",
              "query":"required"
       }
    }
  </script>

I want to add one more potentialAction to WebSite. Is it possible by cloning current json-ld and changing values? Or by changing current json-ld?

Upvotes: 1

Views: 996

Answers (1)

Tony McCreath
Tony McCreath

Reputation: 3409

The typical solution for this is to change the object in the property to an array of objects. e.g. "potentialAction": {...} changes to "potentialAction": [{...},{...}].

However, you will have to test to see if the system consuming the information can deal with that.

Upvotes: 2

Related Questions