構造化データをまとめてみた(JSON-LD + schema.org)
公開日:
最終更新日:
構造化データ書くとき、毎回調べて記述してるので、いい加減まとめようと思ってまとめました。
間違ってるぞバカヤローとか、こうの方がいいでとか、何でもご意見あれば喜びます。
書いた後はSchema Markup Validatorかリッチリザルトテストツールでチェックしてくださいね。
ちなみにheadタグの一番下とかに書いていただければ。(bodyの閉じタグの上とかでもいいです)
日付の書き方は、2018-06-27な感じです。
求人情報を追加しました
websiteってやつ(トップページかな)
トップページにはこれを書けばいいんじゃないでしょうか?
ローカルビジネスとかはローカルビジネスでいいのかな
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url": "webサイトのurl", "name": "webサイトの名前", "publisher": { "@type": "Organization", "name": "発行してる団体", "url": "発行してる団体のurl", "logo": { "@type": "ImageObject", "url": "発行してる団体のロゴのurl", "width": 横幅, "height": 縦 }, "address": { "@type": "PostalAddress", "postalCode": "発行してる団体の郵便番号", "addressRegion": "発行してる団体の〇〇県", "addressLocality": "発行してる団体の〇〇市", "streetAddress": "発行してる団体の住所続き" } }, "image": { "@type": "ImageObject", "url": "webサイト(書いてるページ)のイメージ", "width": 横幅, "height": 縦 } } </script> |
BlogPostingってやつ(ブログの投稿ページ)
ブログポスティングだし、投稿ページでいいはずです。
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BlogPosting", "mainEntityOfPage": { "@type": "WebPage", "@id": "ページのurl" }, "headline": "ページタイトル", "description": "ページの説明", "datePublished": "記事を書いた日", "dateModified": "記事を更新した日", "author": { "@type": "Person", "name": "書いた人" }, "publisher": { "@type": "Organization", "name": "発行してる団体", "url": "発行してる団体のurl", "logo": { "@type": "ImageObject", "url": "発行してる団体のロゴのurl", "width": 横幅, "height": 縦 }, "address": { "@type": "PostalAddress", "postalCode": "発行してる団体郵便番号", "addressRegion": "発行してる団体〇〇県", "addressLocality": "発行してる団体〇〇市", "streetAddress": "発行してる団体住所続き" } }, "image": { "@type": "ImageObject", "url": "ページのイメージ", "width": 横幅, "height": 縦 } } </script> |
Productってやつ(商品ページ)
これはもうプロダクトですよね。製品ページ
aggregateRatingを追加しました。
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Product", "url": "商品のurl", "name": "商品の名称", "description": "商品の概要", "releaseDate": "商品の発売日(バージョンとかの判定とかに使う的な感じみたいなみたいな)", "image": { "@type": "ImageObject", "url": "商品の画像のurl", "width": 横幅, "height": 縦 }, "offers": { "@type": "Offer", "price": "販売価格", "priceCurrency": "JPY", "url": "商品の販売ページのurl", "availability": "InStock", //InStock [在庫あり] OutOfStock [在庫なし] PreOrder [予約] "validFrom": "販売開始日" }, "brand": { "@context": "http://schema.org", "@type": "Organization", "name": "ブランド名" }, "review": { "@type": "Review", "reviewBody": "レビュー本文", "author": { "@type": "Person", "name": "レビュアー" }, "reviewRating": { "@type": "Rating", "ratingValue": "レビューの点" } }, "aggregateRating": { "@type":"AggregateRating", "bestRating": "最も良かったレビュー(5点満点)", "worstRating": "最も悪かったレビュー(5点満点)", "ratingValue":平均点的なの(5点満点), "reviewCount":レビューの数 } } </script> |
Eventってやつ(何某かのイベントページ)
イベントのページですね。はい。
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Event", "name": "eventの名前", "startDate": "イベント開始日", "endDate": "イベント終了日", "url": "イベントのurl", "description": "イベントの説明", "image": { "@type": "ImageObject", "url": "https://japanvrtourism.com/wp-content/uploads/2018/06/fushimiinari.jpg", "width": 1920, "height": 1280 }, "location": { "@type": "Place", "name": "会場", "address": { "@type": "PostalAddress", "postalCode": "会場の郵便番号", "addressRegion": "会場の〇〇県", "addressLocality": "会場の〇〇市", "streetAddress": "会場の住所続き" } }, "offers": { "@type": "Offer", "price": "金額", "priceCurrency": "JPY", "url": "チケットのurl", "availability": "in_stock", //in_stock [在庫あり] out_of_stock [在庫なし] preorder [予約] "validFrom": "販売開始日" }, "composer": { "@type": "Organization ", "name": "主催団体", "url": "urlがあれば", "logo": { "@type": "ImageObject", "url": "主催団体のロゴのurl", "width": 横幅, "height": 縦 }, "address": { "@type": "PostalAddress", "postalCode": "主催団体の郵便番号", "addressRegion": "主催団体の〇〇県", "addressLocality": "主催団体の〇〇市", "streetAddress": "主催団体の住所続き" } }, "Performer": [{ "@type": "person", "name": "出演者", "url": "urlがあれば" }, { "@type": "person", "name": "出演者", "url": "urlがあれば" }] } </script> |
LocalBusinessってやつ(町のお店:全般的なの)
これも何やら細かくあるんですが、とりあえず全般的なのです。
レストランは次に書きます
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "LocalBusiness", "name": "お店の名前", "url": "お店のurl", "description": "お店の説明", "telephone": "電話番号", "openingHours": "Mo,Tu,We,Th,Fr 09:00-17:00", //営業時間 "priceRange": "1000-2000", "address": { "@type": "PostalAddress", "postalCode": "郵便番号", "addressRegion": "〇〇県", "addressLocality": "〇〇市", "streetAddress": "住所続き" }, "geo": { "@type": "GeoCoordinates", "latitude": 緯度, "longitude": 経度 }, "image": { "@type": "ImageObject", "url": "ページのイメージ", "width": 横幅, "height": 縦 } } </script> |
Restaurantってやつ(レストラン:予約できます的なのが出来たりする)
レストランです。
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Restaurant", "name": "お店の名前", "url": "お店のurl", "description": "お店の説明", "telephone": "電話番号", "openingHours": "Mo,Tu,We,Th,Fr 09:00-17:00", //営業時間 "servesCuisine": "何料理か", "priceRange": "予算感", "menu": "http://www.example.com/menu", "acceptsReservations": "True", "address": { "@type": "PostalAddress", "postalCode": "郵便番号", "addressRegion": "〇〇県", "addressLocality": "〇〇市", "streetAddress": "住所続き" }, "geo": { "@type": "GeoCoordinates", "latitude": 緯度, "longitude": 経度 }, "image": { "@type": "ImageObject", "url": "ページのイメージ", "width": 横幅, "height": 縦 } } </script> |
パンくず
パンくずのマークアップ
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "item": { "@id": "親ページのurl", "name": "親ページ(homeとか)" } }, { "@type": "ListItem", "position": 2, "item": { "@id": "2階層目のurl", "name": "2階層目の名前" } }, { "@type": "ListItem", "position": 3, "item": { "@id": "3階層目のurl", "name": "3階層目の名前" } } ] } </script> |
求人情報
日本でも対応された求人にかんするマークアップ
コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<script type="application/ld+json"> { "@context" : "https://schema.org/", "@type" : "JobPosting", "title" : "求人する職業(エンジニアとか)", "description" : "<p>上の説明</p>", "datePosted" : "求人の公開日", "validThrough" : "求人の公開終了日", "employmentType" : "FULL_TIME(使用できるもの "FULL_TIME","PART_TIME","CONTRACTOR","TEMPORARY","INTERN","VOLUNTEER","PER_DIEM","OTHER")", "hiringOrganization" : { "@type" : "Organization", "name" : "会社名", "sameAs" : "発行してる団体のurl", "logo" : "発行してる団体のロゴのurl" }, "jobLocation": { "@type": "Place", "address": { "@type": "PostalAddress", "streetAddress": "求人している場所の住所続き", "addressLocality": "求人している場所の市町村", "addressRegion": "求人している場所の都道府県", "postalCode": "求人している場所の郵便番号", "addressCountry": "JP" } }, "baseSalary": { "@type": "MonetaryAmount", "currency": "JPY", "value": { "@type": "QuantitativeValue", "value": 300000(給料), "minValue": 250000(最低給料), "maxValue": 500000(最大給料), "unitText": "MONTH(使用できるもの "HOUR","DAY","WEEK","MONTH","YEAR")" } } } </script> |
他にも色々あります。
googleのドキュメントがあるので、そちらも参照するといいです。
変なところなどあったらお教えいただけるとありがたいです
すごく助かりました。
ありがとうございます。
そういっていただけると、とてもうれしいです。
ありがとうございます!