Skip to content

getSeoProperties()

The getSeoProperties method is used to get a MetaProperties object that represents SEO properties for current page in the storefront.

Returned value

The MetaProperties object.

Example

source
{% set seo = ObjectApi.getSeoProperties() %}
<title>{{ seo.title }}</title>
<meta name="description" content="{{ seo.description }}">
<meta name="keywords" content="{{ seo.keywords }}">

{% for property in seo.properties %}
    <meta property="{{ property.name }}" content="{{ property.value }}" />
{% endfor %}

{% for link in seo.links %}
    <link rel="{{ link.title }}" href="{{ link.url.absolute }}" />
{% endfor %}
output
<title>Product SEO Title</title>
<meta name="description" content="Product SEO Description">
<meta name="keywords" content="Keyword 1, Keyword 2">

<meta property="og:type" content="product" />
<meta property="og:title" content="Product name" />
<meta property="og:url" content="https://example.com/en/p/product-name/98" />
<meta property="og:description" content="Product description" />
<meta property="og:image" content="https://example.com/environment/cache/images/image.jpg" />
<meta property="og:site_name" content="Site name" />

<link rel="canonical" href="https://example.com/en/p/product-name/98" />