Last edit:  Jan 18, 2019

Contributors:  lemingos diana-lakatos

Metadata is a property to store any kind of key-value pairs. A page can be extended using metadata, for example:

slug: signup
  title: "This it the title"
  description: "A description"
  tags: ["signup", "choose", "landing"]

Displaying metadata on the page

Metadata is available through Liquid as

<h1>{{ page.metadata.title }}</h1>

<section>{{ page.metadata.description }}</section>

  {% for tag in page.metadata.tags %}
    <li>{{ tag }}</li>
  {% endfor %}

<strong>{{ page.metadata.tags | join: "," }}</strong>

Searching for a page using its metadata

You can search for a page using its metadata in GraphQL queries (all support page and per_page pagination arguments). Here's an example of a GraphQL query with all possible parameters.

query find_page(
  $page: Int
  $per_page: Int
  $metadata: String
  $exclude: String
  $has_key: String
  $name: String
  $value: String
) {
  pages: pages(
    page: $page
    per_page: $per_page
    filter: {
      metadata: {
        contains: $metadata,
        has_key: $has_key,
        attribute: {
          key: $name,
          value: $value
        exclude: $exclude
  ) {

    results {

Some examples of using the above query from a Liquid template to find metadata:

Find pages WITH word TITLE somewhere in metadata (in keys or values)

{% execute_query 'find_page', page: 1, per_page: 20, metadata: "TITLE", result_name: 'q' %}

Find pages WITHOUT word TITLE in metadata (in keys or values)

{% execute_query 'find_page', exclude: 'true', metadata: "TITLE", result_name: 'q' %}

Match pages having top-level key tags

{% execute_query 'find_page', has_key: 'tags', result_name: 'q' %}

Match pages without "tags" key

{% execute_query 'find_page', exclude: 'true', has_key: 'tags', result_name: 'q' %}

Match pages with key tags having (or including) value bar

{% execute_query 'find_page', name: 'tags', value: 'bar', result_name: 'q' %}

Match pages that do not have key tags equal (or including) to bar

{% execute_query 'find_page', exclude: 'true', name: 'tags', value: 'bar', result_name: 'q' %}

Related topics


We are always happy to help with any questions you may have. Check out our Help page, or contact us.