Tags
Asked 2 years ago
10 Jun 2021
Views 251
Carolyne

Carolyne posted

How to Add Structured Data to Website

How to Add Structured Data to Website
jessica

jessica
answered Jun 10 '21 00:00

you can put this at home page with real data , i used some dummy detail

<script type="application/ld+json">
 {
  "@context":"http://schema.org",
  "@type":"Organization",
  "url":"https://www.website.com",
  "name":"My Website",
  "logo":"https://www.example.com/logo.png",
  "contactPoint":[
   {"@type":"ContactPoint",
   "telephone":"+X-XXX-XXX-XXX",
   "contactType":"support && service"}
  ],
  "address":{
   "addressCountry":"Country",
   "postalCode":"XXXXX",
   "addressRegion":"Region",
   "addressLocality":"Locality"}
 }
</script>


add also for direct search to website from search enginee

"potentialAction":
   {
   "@type": "SearchAction",
   "target": "https://website.com/?controller=search&search_query={search_term_string}",
   "query": "required",
   "query-input":"required name=search_term_string"
   }


so final code will be look like

<script type="application/ld+json">
 {
  "@context":"http://schema.org",
  "@type":"Organization",
  "url":"https://www.website.com",
  "name":"My Website",
  "logo":"https://www.example.com/logo.png",
  "contactPoint":[
   {"@type":"ContactPoint",
   "telephone":"+X-XXX-XXX-XXX",
   "contactType":"support && service"}
  ],
  "address":{
   "addressCountry":"Country",
   "postalCode":"XXXXX",
   "addressRegion":"Region",
   "addressLocality":"Locality"}
 }

"potentialAction":
   {
   "@type": "SearchAction",
   "target": "https://website.com/?controller=search&search_query={search_term_string}",
   "query": "required",
   "query-input":"required name=search_term_string"
   }
</script>

you can test website schema at
rich results checker from google
enter url and click on Test Url button to verify schema , it will show error and warning if there is any
web-api

web-api
answered Jun 10 '21 00:00

for the product
sample schema

<script type="application/ld+json">
 {
  "@context": "https://schema.org/",
  "@type": "Product",
    "name": "Tech drive",
    "image": [
     "https://arrayoverflow.com/productimages/image.png" 
    ],
    "description": "Put here description",
    "sku": "12121255",
    "mpn": "55555",
    "brand": {
     "@type": "Brand",
     "name": "Arrayoverflow"
   },
    "review": {
     "@type": "Review",
     "reviewRating": {
       "@type": "Rating",
       "ratingValue": "4",
       "bestRating": "5"
      },
     "author": {
       "@type": "Person",
       "name": "Tester"
     }
   },
    "aggregateRating": {
      "@type": "AggregateRating",
    "ratingValue": "4.8",
      "reviewCount": "64"
    },
   "offers": {
    "@type": "Offer",
    "url": "https://arrayoverflow.com/product/techdrive.html",
    "priceCurrency": "USD",
    "price": "101",
     "priceValidUntil": "2025-02-05",
    "itemCondition": "https://schema.org/NewCondition,
     "availability": "https://schema.org/InStock",
    "seller": {
      "@type": "Organization",
       "name": "Arrayoverflow"
    }
   }
 }
</script>
Post Answer