Ways to load Rebuy on specific themes or for specific customers
You can limit where Rebuy loads on your Shopify store in these ways:
On specific themes, with the Rebuy Connector. Turn on the Rebuy Connector app embed only in the themes where you want Rebuy. No theme code needed.
For some customers but not others. Add a Rebuy script to your theme that skips customers with a specific customer tag.
Every method in this article works by leaving your store with only one thing that loads Rebuy. Rebuy can load from the Rebuy Connector app embed while Enable Rebuy JS via Rebuy Connector (formerly Install Rebuy Script Tag and Disable Rebuy JS) is on, from a Shopify script tag added before October 1st, 2026, from Rebuy widget app blocks, and from a <script> tag in your theme code that loads rebuy.js. If one of these is still loading Rebuy where you do not want it, Rebuy keeps loading there.
If you only want to try Rebuy on a draft theme before going live, Storefront Preview Mode may be simpler. You can keep widgets turned off in live mode and preview them on your live store and draft themes with no code changes. To load Rebuy only on certain pages, such as product pages, see How To Load Rebuy JS Only On Specific Pages.
Load Rebuy on specific themes with the Rebuy Connector
To load Rebuy only on specific Shopify themes with no theme code, turn on the Rebuy Connector app embed in the themes where you want Rebuy and leave it off in the others. Shopify turns app embeds on and off separately for each theme, so the Rebuy Connector only loads Rebuy on themes where it is on. This method works on Online Store 2.0 and vintage themes.
In your Shopify admin, go to Sales channels > Online Store.
For each theme where you want Rebuy, click Customize, click the App embeds icon in the left sidebar, turn on the app embed named Rebuy Connector, and click Save.
For each theme where you do not want Rebuy, click Customize, click the App embeds icon, turn off Rebuy Connector, and click Save. Turn off Rebuy A/B Testing Support on that theme too. It does not load Rebuy on its own, but turning it off leaves the theme with no Rebuy app embeds on.
On each theme where you do not want Rebuy, remove every Rebuy Widget app block. Rebuy Widget app blocks load Rebuy on the pages where they are placed, even when the Rebuy Connector is off. In the theme editor, open each template that has a Rebuy widget, such as Default product, select the Rebuy Widget block in the left sidebar, click the trash icon to remove it, and click Save.
In the Rebuy admin, go to the Settings tab and select App Settings. In the Load Rebuy through the Rebuy Connector panel at the top of the page, check that Enable Rebuy JS via Rebuy Connector is on. This setting applies to your whole store, not to one theme, and the Rebuy Connector only loads Rebuy while it is on. The Rebuy Connector app embed in each theme is what decides which themes load Rebuy.
Leave Enable Rebuy JS via script tag (legacy, ends Mar 1, 2027) in the General Settings section as it is.
Check each theme where you do not want Rebuy, using the steps in the section on checking a theme for Rebuy app embeds and app blocks below.
Check a theme for Rebuy app embeds and app blocks
To confirm that a Shopify theme has nothing left that loads Rebuy, search the theme's code for rebuy. The search shows every Rebuy app embed, every Rebuy Widget app block, and every Rebuy script in the theme, including on templates you have not opened in the theme editor.
In your Shopify admin, go to Sales channels > Online Store, click the ... button next to the theme, and select Edit code.
Click the Search icon in the left sidebar of the code editor and search for
rebuy.In
config/settings_data.json, find the result whose type containsrebuy-global-embed. This is the Rebuy Connector app embed. The line below it reads"disabled": truewhen the Rebuy Connector is off on this theme.Check the results in the
templatesandsectionsfolders. A result with a type that containsblocks/rebuy-widget, in a file such astemplates/product.json, means a Rebuy Widget app block is still placed on that template, and Rebuy loads on those pages. Remove it in the theme editor, as described in the steps above.Check the results in
.liquidfiles. A<script>tag that loadsrebuy.jsalso loads Rebuy on this theme.
When the only results are in config/settings_data.json and each Rebuy app embed reads "disabled": true, the theme has no Rebuy app embeds turned on and no Rebuy Widget app blocks.
Remove an old Shopify script tag that loads Rebuy on every theme
If Rebuy still loads on a theme where the Rebuy Connector is off, no Rebuy Widget app block is placed, and the theme's code has no <script> tag that loads rebuy.js, your store still has a Shopify script tag from before October 1st, 2026, which loads Rebuy on every theme. A Shopify script tag ignores the Rebuy Connector app embed settings in your themes, so it has to be removed for the Rebuy Connector method in this article to work. To remove it, turn off Enable Rebuy JS via Rebuy Connector, wait until the script tag is gone, then turn the setting back on. Turning the setting off permanently removes your store's Shopify script tag, and turning it back on lets the Rebuy Connector load Rebuy again on the themes where it is on.
In the Rebuy admin, go to Settings > App Settings and turn off Enable Rebuy JS via Rebuy Connector.
Open a page of your published theme that has no Rebuy Widget app block, such as your home page, and check for
rebuy.jsin the Network tab of your browser's developer tools, using the check in How To Load Rebuy JS Only On Specific Pages. Reload the page untilrebuy.jsno longer appears, which means the script tag has been removed.Turn Enable Rebuy JS via Rebuy Connector back on.
Do not turn Enable Rebuy JS via Rebuy Connector back on while rebuy.js still appears on that page. Rebuy removes the script tag only if the setting is still off when the removal runs, so turning it back on too soon leaves the script tag in place. While the setting is off, Rebuy does not load on pages without a Rebuy Widget app block.
Hide Rebuy from customers with a specific tag
To stop Rebuy from loading for certain customers, tag those customers in Shopify, add a Rebuy script to your theme that skips anyone with that tag, replace any Rebuy Widget app blocks with widgets installed in your theme code, then turn off Enable Rebuy JS via Rebuy Connector. The Rebuy Connector and Rebuy Widget app blocks cannot check customer tags, so this method always uses theme code. A Rebuy Widget app block loads Rebuy for every customer who visits its page, tagged or not, so this method only hides Rebuy on pages with no Rebuy Widget app blocks. Add the script first, since turning off Enable Rebuy JS via Rebuy Connector stops Rebuy loading for every customer, on every theme, until your script is in place.
Rebuy Support can explain these steps but does not edit theme code, so you or your own developer make the changes.
Step 1: Add the customer tag script to theme.liquid
To hide Rebuy from tagged customers, give those customers a common tag in Shopify, such as wholesale, then add this script to your theme.
In your Shopify admin, go to Sales channels > Online Store, click the ... button next to your published theme, and select Edit code.
Open
layout/theme.liquid.Find the
<meta charset>tag near the top of the file, inside the<head>. PressCmd+Fon a Mac orCtrl+Fon Windows and search forcharset.Paste the code below on the line directly below the
<meta charset>tag.Replace
insert tag herewith your customer tag, and save the file. The tag must match exactly, including capitalization, soWholesaleandwholesaleare different tags.
{% unless customer.tags contains 'insert tag here' %}
<link rel="preconnect" href="https://cdn.rebuyengine.com">
<link rel="preconnect" href="https://rebuyengine.com" crossorigin>
<link rel="preconnect" href="https://cached.rebuyengine.com" crossorigin>
<script async src="https://cdn.rebuyengine.com/onsite/js/rebuy.js?shop={{ shop.permanent_domain }}"></script>
{% endunless %}For example, if your tag is wholesale, the first line reads:
{% unless customer.tags contains 'wholesale' %}
This code loads Rebuy only for customers who do not have the tag, from the <head> of the page, so Rebuy starts loading as early as it does through the Rebuy Connector. Customers with the tag see your store without Rebuy features once your Rebuy Widget app blocks are replaced and Enable Rebuy JS via Rebuy Connector is off.
If you publish a different theme later, add the same code to that theme's layout/theme.liquid before you publish it. Enable Rebuy JS via Rebuy Connector applies to every theme, so once it is off, a theme without the code does not load Rebuy for any customer.
Step 2: Replace Rebuy Widget app blocks with theme code installs
To hide Rebuy from tagged customers on pages that show Rebuy widgets, install those widgets in your theme code instead of as Rebuy Widget app blocks. A Rebuy Widget app block loads Rebuy on its page for every customer, even a customer with your tag, and the customer tag script cannot stop it. A widget installed in your theme code only appears once Rebuy loads, so it stays hidden for customers your script skips.
For each widget placed as a Rebuy Widget app block, install it in your theme code, following Manually Installing Widgets.
In the theme editor, open each template that has a Rebuy widget, such as Default product, select the Rebuy Widget block in the left sidebar, click the trash icon to remove it, and click Save.
To confirm none are left, search the theme's code for
rebuy, using the steps in the section on checking a theme for Rebuy app embeds and app blocks. No result should have a type that containsblocks/rebuy-widget.
Step 3: Turn off automatic Rebuy loading for tagged customers
After the customer tag script is in place, turn off Enable Rebuy JS via Rebuy Connector so the Rebuy Connector stops loading Rebuy on every theme, leaving your script as the only thing that loads Rebuy. Without this step, the Rebuy Connector keeps loading Rebuy for every customer.
In the Rebuy admin, go to the Settings tab and select App Settings.
In the Load Rebuy through the Rebuy Connector panel at the top of the page, turn off Enable Rebuy JS via Rebuy Connector. This setting saves as soon as you turn it off, with no Save button.
Leave the Rebuy Connector on in your theme's App embeds. With Enable Rebuy JS via Rebuy Connector off, the Rebuy Connector no longer loads Rebuy, but it still passes customer and market details, such as customer tags, country, and language, to Rebuy.
Leave Enable Rebuy JS via script tag (legacy, ends Mar 1, 2027) in the General Settings section as it is. Turning off Enable Rebuy JS via Rebuy Connector permanently removes your store's Shopify script tag, so the legacy setting no longer loads Rebuy for tagged customers.
Step 4: Check Rebuy as a tagged customer
To confirm the customer tag method works, sign in to your store as a customer who has your tag and check that Rebuy does not load.
In a normal browser window, open your published theme and sign in as a test customer who has your tag. Do not test in the Shopify theme editor, since the theme editor preview is never signed in as a customer, so the script loads Rebuy there for everyone.
Open a page that shows Rebuy widgets for other customers, such as a product page.
Right-click the page, select Inspect, and open the Network tab.
Type
rebuy.jsin the filter box and reload the page.rebuy.jsshould not appear in the list.
If rebuy.js still appears, check that the test customer is signed in, that no Rebuy Widget app block is placed on that page's template, and that your theme code has no other <script> tag that loads rebuy.js outside the customer tag check.
FAQs
Does Enable Rebuy JS via Rebuy Connector apply to one theme or to every theme?
Enable Rebuy JS via Rebuy Connector applies to every theme in your store, not only your published theme. The setting is saved once for your store, and the Rebuy Connector app embed reads it on every theme where the embed is on, including draft themes and theme previews. To control which themes load Rebuy, turn the Rebuy Connector app embed on or off in each theme's App embeds and leave Enable Rebuy JS via Rebuy Connector on. Turning the setting off stops the Rebuy Connector from loading Rebuy on every theme at once.
Do I still need the Rebuy script in my theme code to load Rebuy on specific themes?
No, you do not need the Rebuy script in your theme code to load Rebuy on specific themes, since the Rebuy Connector does the same job with no code. Turn on the Rebuy Connector app embed only in the themes where you want Rebuy, as described in the Rebuy Connector method in this article. The Rebuy Connector loads Rebuy from the <head> of each page, so Rebuy starts loading as soon as the browser starts reading the page.
If your store already loads Rebuy from a <script> tag in the theme code of specific themes, that code keeps working, since code in your theme files is not a Shopify script tag. To switch, turn on the Rebuy Connector in those themes, turn on Enable Rebuy JS via Rebuy Connector, then remove the <script> tag that loads rebuy.js, following the FAQ on removing the code that loads Rebuy in Load Rebuy Faster. Theme code is still needed to hide Rebuy from customers with a specific tag, since the Rebuy Connector cannot check customer tags.
Do Rebuy Widget app blocks follow the customer tag script?
No, Rebuy Widget app blocks do not follow the customer tag script, so a page with a Rebuy Widget app block loads Rebuy for every customer, including customers with your tag. The customer tag script only controls the Rebuy script it wraps, and a Rebuy Widget app block loads Rebuy on its own page whatever your Rebuy settings are. To hide Rebuy from tagged customers on a page with Rebuy widgets, install those widgets in your theme code, following Manually Installing Widgets, and remove the Rebuy Widget app blocks from your theme.
Do customers need to be signed in for the customer tag method to work?
Yes, customers must be signed in for the customer tag method to hide Rebuy, since Rebuy can only read the tag of a signed-in customer. A guest browsing your store has no customer tags, so the script loads Rebuy for them.
Why is Rebuy still loading after I turned off automatic loading?
If Rebuy still loads after you turned off Enable Rebuy JS via Rebuy Connector, something else on your store is still loading Rebuy. Check each of these:
Enable Rebuy JS via Rebuy Connector is off in Settings > App Settings, so the Rebuy Connector does not load Rebuy. Leave the Rebuy Connector app embed itself on.
No Rebuy Widget app blocks are placed on the pages where you do not want Rebuy.
Your theme files have no other copies of the Rebuy script.
To check the app blocks and theme files in one pass, search the theme's code for rebuy, using the steps in the section on checking a theme for Rebuy app embeds and app blocks.
Why isn't my customer tag script working for wholesale or B2B customers?
If the customer tag script is not hiding Rebuy for wholesale or B2B customers, check that those customers are signed in, since the script can only read tags for signed-in customers. Also check that no Rebuy Widget app blocks are placed on the pages they visit, since a Rebuy Widget app block loads Rebuy for every customer, tagged or not, regardless of the script. If your goal is to run Rebuy for B2B customers rather than hide it, see Integrating Rebuy with your Wholesale or B2B store.
Will this work if the Rebuy script is in more than one place in my theme?
No, the customer tag method does not work if the Rebuy script appears in more than one place in your theme files, since Rebuy loads from any copy not wrapped in the customer tag check. Search your theme code for rebuy.js and keep only the conditional script.
Will Shopify's script tag changes break Rebuy code I added to my theme?
No, Shopify's script tag changes do not affect Rebuy code you added to your own theme files. Shopify is retiring script tags that apps add from outside your theme, and code in your theme files is not a script tag. The customer tag script in this article, and any other <script> tag in your theme code that loads rebuy.js, keep working after October 1st, 2026 and March 1st, 2027.






