---
title: Add SEO metadata to your theme
description: Learn how to add metadata to your theme to allow search engines to find key information about the site.
source_url:
html: https://shopify.dev/docs/storefronts/themes/seo/metadata
md: https://shopify.dev/docs/storefronts/themes/seo/metadata.md
---
# Add SEO metadata to your theme
You can include search engine optimization (SEO) metadata in your theme using HTML and Liquid. There are three main aspects to consider:
* The [title tag](#the-title-tag)
* The [meta description](#the-meta-description)
* [Canonical URLs](#canonical-urls)
The code for the above SEO metadata should be included in the `
` element.
For example:
## layouts/theme.liquid
```liquid
{{ page_title -}}
{%- if current_tags %} – tagged "{{ current_tags | join: ', ' }}"{% endif -%}
{%- if current_page != 1 %} – Page {{ current_page }}{% endif -%}
{%- unless page_title contains shop.name %} – {{ shop.name }}{% endunless -%}
{% if page_description %}
{% endif %}
```
Tip
For another example of including metadata in a theme, you can refer to [Dawn's implementation](https://github.com/Shopify/dawn/blob/main/layout/theme.liquid).
### The title tag
You can include a `` element for search engines to read the page title from. The title for most pages can be set in the Shopify admin, and you can access this title with the Liquid [page\_title object](https://shopify.dev/docs/api/liquid/objects/page_title).
### The meta description
You can include a `` element for search engines to read the page description from. The description for most pages can be set in the Shopify admin, and you can access this description with the Liquid [page\_description object](https://shopify.dev/docs/api/liquid/objects/page_description).
### Canonical URLs
You can specify a canonical URL for a given page using the global Liquid [canonical\_url object](https://shopify.dev/docs/api/liquid/objects/canonical_url).
***