Skip to content

Instantly share code, notes, and snippets.

@ardianta
Last active April 4, 2024 14:09
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ardianta/0d3b3ded059f7e6d07b3528793376b5e to your computer and use it in GitHub Desktop.
Save ardianta/0d3b3ded059f7e6d07b3528793376b5e to your computer and use it in GitHub Desktop.
Valid JSON-LD for Blogger
<script type="application/ld+json">
{ "@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "<data:post.title/>",
"alternativeHeadline": "<data:post.title/>",
"mainEntityOfPage" : "<data:blog.homepageUrl/>",
"image": {
"@type" : "imageObject",
"url" : "<data:post.firstImageUrl/>",
"height": "480",
"width": "720"
},
"award": "Artikel Terbaik",
"editor": "<data:post.author/>",
"genre": "<b:loop values='data:post.labels' var='label'><data:label.name/> </b:loop>",
"keywords": "<b:loop values='data:post.labels' var='label'><data:label.name/> </b:loop>",
"wordcount": "960",
"publisher": {
"@type" : "organization",
"name" : "Petani Kode",
"logo": {
"@type" : "imageObject",
"url" : "http://4.bp.blogspot.com/-JhaYXK15wjs/V4vM897_yCI/AAAAAAAADDU/wVWMf3MZ060TmopvbPgWl1bYbTcv2a6cQCK4B/s1600/petanikode-logo-2016.png", "contentUrl":"http://4.bp.blogspot.com/-JhaYXK15wjs/V4vM897_yCI/AAAAAAAADDU/wVWMf3MZ060TmopvbPgWl1bYbTcv2a6cQCK4B/s1600/petanikode-logo-2016.png"
}
},
"url": "<data:post.url.canonical/>",
"datePublished": "<data:post.timestampISO8601/>",
"dateCreated": "<data:post.timestampISO8601/>",
"dateModified": "<data:post.timestampISO8601/>",
"description": "<data:blog.metaDescription/>",
"articleBody": "<data:post.body.jsonEscaped/>",
"author": {
"@type": "Person",
"name": "<data:post.author/>"
}
}
</script>
<!-- tested: https://search.google.com/structured-data/testing-tool/u/0/#url=http%3A%2F%2Fwww.petanikode.com%2F2016%2F07%2Fmengatasi-malsalah-posisi-titik-tengah.html -->
@blakbin
Copy link

blakbin commented Oct 25, 2018

i found one how to implement that code Imlementing JSON-LD Blog Posting in Blogger

@illvart
Copy link

illvart commented Dec 7, 2018

Please change "articleBody": "<data:blog.metaDescription/>" to "articleBody": "<data:post.body.jsonEscaped/>".

@bsmall000
Copy link

Thank you

@astectic
Copy link

This work

@Enggarnanto
Copy link

Script diatas itu masuk ke setup tema atau editor teks postingan? Soalnya aku pakai Script ini juga works, misalnya postingan aku yang judulnya Destinasi Wisata di Kalimatan Timur Dekat IKN . Kalau di search pakai operator site: ada AggregateRating juga.

Contonnya aku buat di web generator online.

<script type='application/ld+json'> { "@context": "http://schema.org", "@type": "Articles", "name": "Galih Enggarnanto", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4", "ratingCount": "50", "reviewCount": "60" } } </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment