schema.org for the site
The last notes
All English-language materials have been translated fully automatically using the Google service
We mark company data on schema.org (http://schema.org/LocalBusiness and http://schema.org/Organization)
Main company with micro-markup
<div rel="nofollow" itemscope itemtype="http://schema.org/LocalBusiness" href="tel:+77777777777">
<span itemprop="name">Your organization</span>
<img itemprop="logo" alt="Logo" title="Logo" src="https://site.ru/upload/aspro.mshop/65a/65a3d5310d7569769c463d2a40ef86cc.png" />
<link itemprop="url" href="https://site.ru/" />
<meta itemprop="priceRange" content="От 20 RUB">
<meta itemprop="telephone" content="+77777777777">
<meta itemprop="email" content="email@email.ru">
<meta itemprop="faxNumber" content="+7 (999) 999-99-99">
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="postalCode">postcode</span>,
<span itemprop="addressCountry">The country</span>,
<span itemprop="addressRegion">Region</span>,
<span itemprop="addressLocality">City</span>,
<span itemprop="streetAddress">street, house_number</span>
</div>
</div>
Branch with micro-markup
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="name">LLC "Company"</span>
<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="postalCode" content="999999">
<meta itemprop="streetAddress" content="street, house, office">
<meta itemprop="addressLocality" content="Moscow">
</span>
<span itemprop="telephone">8 (800) 999–99–99</span>
<span itemprop="email">email@email.ru</span>
<time itemprop="openingHours" datetime="Mo-Fr, 9:00−18:00">Пн-Пт, 9:00 – 18:00</time>
<img itemprop="image" src="link to branch image" />
</div>
Microformat hCard
<div class="vcard">
<div>
<span class="category">Online store</span>
<span class="fn org">LLC "Company"</span>
</div>
<div class="adr">
<span class="locality">Moscow city</span>,
<span class="street-address">street, house, office</span>
</div>
<div>Телефон: <span class="tel">+7 (800) 999–99–99</span></div>
<div>Мы работаем <span class="workhours">daily from 11:00 to 24:00</span>
<span class="url">
<span class="value-title" title="https://site.ru/"> </span>
</span>
</div>
</div>
Marking up breadcrumbs using schema.org (https://schema.org/BreadcrumbList)
<ul itemscope itemtype="https://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/" title="home" itemprop="item">
<span itemprop="name">home</span>
<meta itemprop="position" content="0">
</a></li>
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/razdel/" title="Section" itemprop="item">
<span itemprop="name">Section</span>
<meta itemprop="position" content="1">
</a></li>
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/razdel/podrazdel/" title="Subsection" itemprop="item">
<span itemprop="name">Subsection</span>
<meta itemprop="position" content="2">
</a>
</li>
</ul>
Marking up the FaqPage (https://schema.org/FAQPage). One question - 1 answer
<div itemscope itemtype="https://schema.org/FAQPage">
<div itemprop="mainEntity" itemscope itemtype="https://schema.org/Question">
<div itemprop="name">Question title</div>
<div itemprop="text">The question itself (you can omit and leave only the name field)</div>
<meta itemprop="answerCount" content="1">
<div itemprop="upvoteCount">196</div> // Number of people who voted for the question
<div itemprop="acceptedAnswer" itemscope="" itemtype="http://schema.org/Answer">
<div itemprop="upvoteCount"/>3</div> //Number of people who voted for the answer
<span itemprop="text">Response text</span>
</div>
</div>
</div>
Marking up the FaqPag (https://schema.org/FAQPage) json+ld
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "What is the return policy?",
"acceptedAnswer": {
"@type": "Answer",
"text": "<p>Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.</p><p>Online purchases may be returned via a major parcel carrier. <a href=http://example.com/returns> Click here </a> to initiate a return.</p>"
}
}, {
"@type": "Question",
"name": "How long does it take to process a refund?",
"acceptedAnswer": {
"@type": "Answer",
"text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
}
}]
}
</script>
We mark the product according to schema.org (http://schema.org/Product)
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Product Name</span>
<img src="Photo.jpg" itemprop="image" />
<div itemprop="description">Product description</div>
<div>Manufacturer: <span itemprop="brand">Brand name</span></div>
<div>Model: <span itemprop="model">Model</span></div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4</span> //Average rating
<span itemprop="reviewCount">9</span> //number of ratings
</div>
<meta itemprop="sku" content="4" />
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="700" />
<meta itemprop="priceCurrency" content="RUB" />
<meta itemprop="availability" content="http://schema.org/<?=($offer['CAN_BUY'] ? 'InStock' : 'OutOfStock')?>" />
<meta itemprop="priceValidUntil" content="2013-09-14T21:30">
<div itemprop="review" itemscope itemtype="http://schema.org/Review">
<span itemprop="name">Review title</span>
from <span itemprop="author">Username</span>,
<meta itemprop="datePublished" content="2021-08-01">
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<meta itemprop="worstRating" content="1"> //Minimum score
<span itemprop="ratingValue">4</span> //User rating
<span itemprop="bestRating">5</span>stars. //Maximum score
<span itemprop="description">review_text</span>
</div>
</div>
</div>
Marking up the QAPage (https://schema.org/QAPage). One question, several answers
<div itemscope itemtype="https://schema.org/QAPage">
<div itemscope itemtype="http://schema.org/Question">
<h1 itemprop="name">Question title</h1>
<div itemprop="upvoteCount">196</div>
<div itemprop="text">The question itself (you can omit and leave only the name field)</div>
<meta itemprop="answerCount" content="1"> //Total Answers
<div><time itemprop="dateCreated" datetime="2020-01-20T15:07Z">20 января, 15:03</time></div>
<div itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Name of the person who asked the question</span></div>
<div itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
<div itemprop="upvoteCount">Votes for answer</div>
<div itemprop="text">Response text</div>
<div>Date of publication of the review <time itemprop="dateCreated" datetime="2020-01-20T15:08Z">20 января, 15:08</time></div>
<div itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Responder name</span></div>
</div>
<div itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
<div itemprop="upvoteCount">Votes for answer</div>
<div itemprop="text">Response text</div>
<div>Date of publication of the review <time itemprop="dateCreated" datetime="2020-01-20T15:09Z">20 января, 15:09</time></div>
<div itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Responder name</span></div>
</div>
</div>
</div>
We mark up articles on schema.org (https://schema.org/Article) in the format json+ld
<script type="application/ld+json">
{ "@context": "https://schema.org",
"@type": "Article",
"headline": "Extra! Extra! Read alla bout it",
"alternativeHeadline": "This article is also about robots and stuff",
"image": "http://example.com/image.jpg",
"author": "Patrick Coombe",
"award": "Best article ever written",
"editor": "Craig Mount",
"genre": "search engine optimization",
"keywords": "seo sales b2b",
"wordcount": "1120",
"publisher": {
"@type": "Organization",
"name": "Google",
"logo": {
"@type": "ImageObject",
"url": "https://google.com/logo.jpg"
}
},
"url": "http://www.example.com",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"datePublished": "2015-09-20",
"dateCreated": "2015-09-20",
"dateModified": "2015-09-20",
"description": "We love to do stuff to help people and stuff",
"articleBody": "You can paste your entire post in here, and yes it can get really really long."
}
</script>
Example of script output in json+ld
format in tempate.php
component news.detail
<?
$textCleared = $arResult['DETAIL_TEXT'];
$textCleared = strip_tags($textCleared);
$textCleared = str_replace('#rojkovaya#', '' , $textCleared);
$textCleared = str_replace(' ', '' , $textCleared);
$textCleared = str_replace('—', '' , $textCleared);
$textCleared = str_replace('»', '' , $textCleared);
$textCleared = str_replace('«', '' , $textCleared);
$articlesSchema = [
'@context' => "https://schema.org",
'@type' => "Article",
'headline' => $arResult['NAME'],
'image' => $arResult['DETAIL_PICTURE']['SRC'],
'wordCount' => str_word_count($textCleared),
'publisher' => [
'@type' => "Organization",
'name' => "ORGANIZATION_NAME",
'logo' => [
'@type' => "ImageObject",
'url' => "FULL_URL",
]
],
'url' => $APPLICATION->GetCurPage(false),
'mainEntityOfPage' => [
'@type' => 'WebPage',
'@id' => "https://google.com/article",
],
'description' => strip_tags($arResult['PREVIEW_TEXT']),
'articleBody' => $textCleared,
];
if($arResult['PROPERTIES']['AUTHOR']['VALUE']) $articlesSchema['author'] = $arResult['PROPERTIES']['AUTHOR']['VALUE'];
if($arResult['ACTIVE_FROM']) $articlesSchema['datePublished'] = strtolower(FormatDate("Y-m-d", MakeTimeStamp($arResult['ACTIVE_FROM'])));
if($arResult['DATE_CREATE']) $articlesSchema['dateCreated'] = strtolower(FormatDate("Y-m-d", MakeTimeStamp($arResult['DATE_CREATE'])));
if($arResult['TIMESTAMP_X']) $articlesSchema['dateModified'] = strtolower(FormatDate("Y-m-d", MakeTimeStamp($arResult['TIMESTAMP_X'])));
?>
<script type="application/ld+json">
<?=str_replace("'", "\"", CUtil::PhpToJSObject($articlesSchema, false, true));?>
</script>
Comments