Boost Shopify Product Search Rankings Using Metafields in Search & Discovery

7 min setup
No coding required
Runs automatically

Enhance your product visibility in Shopify search results by using existing metafields to power the “Search & Discovery Boost Keywords” feature. This MESA workflow template triggers when a product is updated, retrieves specified metafield values, and adds them to the product’s Boost list if not empty. Automate search optimization and improve product discoverability without manual updates.

Shopify logo icon
Product Updated
Retrieve Product Metafield
Filter: Check metafield value
Retrieve "Search Boost" Metafield
Custom: Add new value to list
Shopify logo icon
Update Metafield

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

How it works

6 steps to start boosting product search rankings automatically with custom metafields

Shopify logo icon

Product Updated

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger monitors your Shopify products and kicks off the workflow whenever a product gets updated, catching any new search terms you've added through metafields so they can be incorporated into search rankings immediately.

This trigger watches for product updates in real-time and captures the product ID when changes occur. Every time a product gets updated—whether you're changing inventory, descriptions, or metafields—the workflow starts automatically and passes the product ID to the next step. No configuration is needed for the trigger itself.

Retrieve Product Metafield

App connector: Shopify • Time to complete: 2 minutes
Why this matters: You need to read the custom metafield that contains your search term before you can add it to the boost list—this step fetches whatever value you've stored in your designated metafield namespace and key.

This step queries Shopify for a specific metafield on the updated product. You need to configure two fields: the metafield namespace and key that contain your custom search terms. For example, you might use namespace "custom" and key "boost_keywords" to store alternative product names or common search phrases. The values from this metafield get passed to the filter step to verify it's not empty.

Filter: Check metafield value

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: You only want to update the search boost list when there's actually a new term to add—this filter prevents the workflow from running unnecessarily when products are updated without any search term metafield changes.

This filter checks whether the metafield retrieved in the previous step contains a value. If the metafield is empty or doesn't exist, the workflow stops here and doesn't modify the search boost list. If a value exists, the workflow continues to add that term to the boost configuration. The comparison happens automatically using the metafield value from the previous step.

Retrieve "Search Boost" Metafield

App connector: Shopify • Time to complete: 1 minute
Why this matters: Before adding a new search term, you need to know what terms are already boosted for this product—this step fetches the existing Shopify Search & Discovery boost list so the new term can be added without overwriting existing ones.

This step queries the Shopify Search & Discovery metafield that stores boosted search queries for the product. It uses the specific namespace "shopify--discovery--product_search_boost" and key "queries" which is Shopify's standard location for search boost configuration. The existing boost values get passed to the next step where they're combined with your new term.

Custom: Add new value to list

App connector: Code • Time to complete: 1 minute
Why this matters: You need to intelligently merge your new search term with any existing boost terms while removing duplicates—this code handles that logic to keep your search configuration clean and effective.

This custom JavaScript step takes the existing boost values from the previous step and adds your new search term to the list. It parses any existing boost values, adds the new value from your custom metafield, then removes duplicates using a Set operation to prevent the same term from appearing multiple times. The combined list of unique search terms gets passed to the final step for updating.

const Mesa = require('vendor/Mesa.js');

/**
 * A Mesa Script exports a class with a script() method.
 */
module.exports = new class {

  /**
   * Mesa Script
   *
   * @param {object} payload The payload data
   * @param {object} context Additional context about this task
   */
  script = (payload, context) => {
    const vars = context.steps;

    let boostValues = JSON.parse(vars.shopify_1.value) ? JSON.parse(vars.shopify_1.value) : [];

    let newValue = vars.shopify_3.value;
    boostValues.push(newValue);

    // Get unique values so there aren't duplicates
    boostValues = [...new Set(boostValues)];

    Mesa.trigger.setTaskExternalData({
      "label": boostValues.join(', ')
    })

    Mesa.output.next(boostValues);
  }
}
Shopify logo icon

Update Metafield

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: The combined list of search terms needs to be written back to Shopify's Search & Discovery configuration so the new terms actually affect search rankings and help customers find products.

This step updates the Shopify Search & Discovery metafield with the complete list of boost terms from the custom code step. It writes to the "shopify--discovery--product_search_boost" namespace and "queries" key, formatting the data as a list of single line text fields. Once updated, Shopify's search algorithm immediately starts considering these boosted terms when ranking products in search results.

Ready to set this up? It only takes 7 minutes.

Our support team will even help you personalize this workflow for free.

Get started →

Make it your own!

Customize this workflow even further:

Boost products based on collections or tags
Add a Filter step after the trigger to only boost search terms for products in specific collections or with certain tags, focusing your search optimization on particular product categories or seasonal items.
Remove outdated search terms automatically
Create a separate scheduled workflow that reviews search boost metafields and removes terms that haven't resulted in conversions over a set time period, keeping your boost list focused on effective keywords.
Sync search terms across product variants
Add a Loop step after retrieving the product to process all variants and apply the same search boost terms to each variant, ensuring consistent discoverability across size or color options.
Log search term additions for analysis
Add a Table step after updating the search boost metafield to record which terms were added, when, and to which products, creating a history you can analyze to understand which search optimizations are most common.

Common questions

What types of search terms work best for boosting?

Will this remove existing search boost terms I've manually added?

Can I use this workflow to boost multiple search terms at once?

Ready to start boosting product search rankings automatically with custom metafields?

7-day free trial • 7 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support