Blink Search Redirects Tool

When a customer searches for a term that has a clear destination — like "black friday" going to /sale, or "boots" going to a boots collection — Shopify's default search results are rarely the best experience. This tool lets you map specific search terms to specific URLs, so those searches become instant redirects instead.

Build your rules, export the JSON, and deploy via a shop metafield and a single Shopify section.

Open tool →
🔎

Search term mapping

Map specific search queries to any destination URL. Multiple terms can share one URL.

📋

Bulk management

Add, edit, and delete rules in one place. Sort, filter, and remove duplicates easily.

📤

JSON export

Exports a grouped JSON array ready to paste directly into the shop metafield.

💾

Save and load

Save your work as a .blink-redirects.json file and reload it any time.

1

Build your redirect rules in the tool

Enter a search term and a redirect URL, then click + Add entry. Add one row per search term. Terms that should redirect to the same URL can be added as separate rows — the tool automatically groups them on export.

2

Copy the JSON output

The right-hand panel shows the exported JSON in the format the Shopify section expects: an array of objects, each with a terms array and a url. Click copy to copy it to your clipboard.

3

Set the shop metafield

In Shopify admin, go to Settings → Custom data → Shops and add a metafield definition if it doesn't exist yet:

  • Namespace: blink
  • Key: search_redirects
  • Type: JSON

Then go to Settings → Custom data → Shops → [your store], find the blink.search_redirects field, and paste in the copied JSON.

4

Add the section to your search template

Copy the section code below into a new file in your theme at sections/blink-search-redirects.liquid. Then in the Shopify theme editor, open your Search template and add the Search Redirects section. Make sure it is set to Enabled.

5

Test it

Search for one of your mapped terms on the storefront. You should be redirected to the destination URL immediately. If it doesn't redirect, check that the metafield is saved as valid JSON and the section is enabled.

Save this as sections/blink-search-redirects.liquid in your theme, then add it to the Search template.

blink-search-redirects.liquid
{% if section.settings.enabled %}
  {%- assign redirects_data = shop.metafields.blink.search_redirects -%}
  {%- if redirects_data != blank -%}
<script>
  window.addEventListener('DOMContentLoaded', function() {
    var searchTerms = "{{ search.terms | downcase }}";
    var redirects = {{ redirects_data.value | json }};
    redirects.forEach(function(entry) {
      entry.terms.forEach(function(term) {
        if (searchTerms.includes(term)) {
          window.location.replace(entry.url);
        }
      });
    });
  });
</script>
  {%- endif -%}
{% endif %}

{% schema %}
{
  "name": "Search Redirects",
  "settings": [
    {
      "type": "checkbox",
      "id": "enabled",
      "label": "Enabled",
      "default": true
    }
  ],
  "presets": [
    {
      "name": "Search Redirects"
    }
  ]
}
{% endschema %}
Substring match, case-insensitive. The section lowercases the search query with Shopify's | downcase filter and checks whether each term appears anywhere in the query using .includes(). This means a term of chelsea will match searches for "chelsea boots", "chelsea shoes", and "chelsea" — but also "chelsea clinton". Keep terms specific enough to avoid unintended matches.

The first matching term wins. Entries are checked in the order they appear in the metafield JSON, so if two rules could match the same query, the one listed earlier takes priority.
Updating redirects: Edit your rules in the tool, copy the new JSON output, and paste it back into the blink.search_redirects metafield. No theme changes needed.

Disabling without removing: To suspend all redirects without deleting your rules, open the theme editor, find the Search Redirects section, and toggle Enabled off.

Save your work: Use the Save button in the tool to download a .blink-redirects.json file. Load it back in whenever you need to make changes.