SEO is the practice of improving a website so that it ranks higher in search engine results pages such as on Google. The goal here is to increase organic (non-paid) traffic to your website.
SEO
What is SEO?
Structured Data
Structured data is a standardised format for providing information about a web page and classifying its content. It helps with SEO by making search engines like Google understand your content more clearly, leading to enhanced search results, such as rich snippets, which are the individual sections of structured data that show in search engine results beyond your typical title, URL, and description.
For structured data, see schema.org. It usually takes the form of JSON-LD which is preferred by Google. This is wrapped in a:
<script type="application/ld+json"></script>
element inside, and at the end of, your head element. It lists the individual rich snippets as a dictionary. An example for a hotel website would be:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "Hotel Name",
"image": "https://image_url.png",
"description": "Website Description.",
"url": "https://www.example_website.com/",
"telephone": "0123456789",
"email": "example_email@gmail.com",
"address": {
"@type": "PostalAddress",
"streetAddress": "Road name",
"addressLocality": "Area Name",
"addressCountry": "Country Code"
},
"amenityFeature": [
{
"@type": "LocationFeatureSpecification",
"name": "Feature",
"value": true
},
],
"checkinTime": "14:00",
"checkoutTime": "12:00",
"starRating": {
"@type": "Rating",
"ratingValue": "4",
"bestRating": "5"
},
"priceRange": "$$",
"geo": {
"@type": "GeoCoordinates",
"latitude": 1,
"longitude":1
}
}
</script>
Microdata
Alternatively you can assign microdata within your HTML files. Wrap your content with a div with itemscope and itemtype. Then define an itemprop for each element inside to give more details. The values that the itemprop can take depend on the itemtype. For example you can find the hotel ones here.
Example from the schema website:
<div itemscope itemtype="https://schema.org/Hotel">
<h1><span itemprop="name">ACME Hotel Innsbruck</span></h1>
<span itemprop="description">
A beautifully located business hotel right in the heart of the alps. Watch the sun rise over the scenic Inn
valley while enjoying your morning coffee.
</span>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">Technikerstrasse 21</span>
<span itemprop="postalCode">6020</span>
<span itemprop="addressLocality">Innsbruck</span>
<span itemprop="addressRegion">Tyrol</span>,
<span itemprop="addressCountry">Austria</span>
</div>
Phone: <span itemprop="telephone">+43 512 8000-0</span>
<img itemprop="photo" src="../media/hotel_front.png" alt="Front view of the hotel" />
Star rating: <span itemprop="starRating" itemscope itemtype="https://schema.org/Rating">
<meta itemprop="ratingValue" content="4">****</span>
Room rates: <span itemprop="priceRange">$100 - $240</span>
</div>