How it works

Follow these 6 simple 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.search_terms" and key "boost_keywords" to store alternative product names or common search phrases. The value from this metafield gets 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.

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.

Frequently asked questions

What types of search terms work best for boosting?
The most effective boost terms are alternative names customers actually use when searching—common misspellings, slang, regional variations, or legacy product names. For example, if you sell "sneakers," you might boost with "tennis shoes" or "trainers" depending on your audience. Avoid generic terms that apply to many products, as these dilute the boost effect.
Will this remove existing search boost terms I've manually added?
No, the custom code step specifically merges your new term with existing boost values rather than replacing them. Any terms you've manually added through Shopify's Search & Discovery interface will remain intact—this workflow only adds new terms and removes duplicates.
Can I use this workflow to boost multiple search terms at once?
The workflow is designed to add one term per product update from a single metafield. If you want to add multiple terms simultaneously, you could store comma-separated values in your custom metafield and modify the custom code step to split them before adding to the boost list.
What is a template?
MESA templates are fully pre-configured workflows built and vetted by Shopify Experts. Unlike competitor templates that provide basic scaffolds requiring extensive setup, MESA templates come with all data variables properly mapped, required fields configured, and steps ready to activate. You can turn them on immediately and start automating.
Can I customize a template?
Absolutely! While our templates work out-of-the-box, every step can be personalized to match your exact business requirements. Add conditional logic, integrate additional apps, or build more sophisticated workflows. MESA's templates provide a solid foundation that you can expand as needed.
Are templates free?
Yes! Our entire library of expert-built, production-ready templates is free to use. Unlike platforms that charge for premium templates or provide only basic scaffolds, MESA gives you access to hundreds of fully-configured, vetted workflows at no additional cost.

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

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 7 min setup • Cancel anytime