How to hide prices on Squarespace

If you’ve tried to hide prices on your Squarespace website but discovered the prices still appear in search results, this solution is for you! It explains how to really remove prices on a Squarespace v7.1 website, not just visibly hide them.

What’s the difference?

Hiding prices with custom CSS will only hide them from humans, but the price information will still be there in the page data. This data provides search engines with contextual information about the product. It’s great for a site's performance in search results but it can be a problem if you are trying to hide the prices! Services like Google will read your supposedly hidden $0.00 price and display your product as FREE in their shopping results. Obviously that’s not a good look for your premium product!

Why might you want to hide your prices?

There are various reasons why you might want to hide product prices on a Squarespace website. For example:

  • To maintain perceived value for exclusive products, like artwork or sculptures.

  • To avoid showing fixed prices for customisable products or services.

  • To adapt pricing for specific audiences or sales strategies.

  • To meet the terms of a reseller agreement (common with skincare products) that prevents you publicly displaying prices.

Free plugin

This plugin is completely free to use.

I build and maintain plugins like this one in my spare time. If it saved you time or solved a tricky problem, buying me a coffee helps keep them coming.

Buy me a coffee

Step 1: Set the price to 0.00

If you want a price to be removed, the first step is to set the product price to 0.00. You can change this by editing the individual product.

Step 2: Removing prices from the page

The code below should be added to the Code Injection Footer panel. If you aren’t sure where to find this, my guide should help.

If you’ve set a product’s prices to β€œ0.00”, this code will remove this price from the product schema. It does this by looking for "0.00" and replacing it with "null", telling robots that a price is not available for this product. It won’t affect products with a valid price (above 0.00).

<!-- Remove product price data from Squarespace product pages ------------------------------>
<!-- End of remove product price data from Squarespace product pages ----------------------->
<!-- Copyright Soundfocus Digital Ltd [https://sf.digital] --------------------------------->
<!-- Use freely in your code injection. Do NOT re-publish. --------------------------------->
<script>
function _0x59a5(_0x57238b,_0x39c0fc){_0x57238b=_0x57238b-0xb5;const _0x14f5eb=_0x14f5();let _0x59a561=_0x14f5eb[_0x57238b];return _0x59a561;}function _0x14f5(){const _0x321b1e=['2987901ZrNJFT','forEach','priceCurrency','stringify','166475jmUOmp','2WVZazU','script[type=\x22application/ld+json\x22]','656836lrJzBb','parse','70047WSlhiV','Product','offers','isArray','JSON-LD\x20scrub\x20error:','14OTnqSe','30GZJOaB','Removing\x20price\x20data.\x20Free\x20plugin\x20by\x20https://sf.digital','querySelectorAll','@type','remove','price','0.00','208886NQRBXo','textContent','2284040ujfVtq','trim','error','8250150oXWVoZ'];_0x14f5=function(){return _0x321b1e;};return _0x14f5();}(function(_0x42571a,_0xa33ba7){const _0x44ace1=_0x59a5,_0x1a0011=_0x42571a();while(!![]){try{const _0x13446e=parseInt(_0x44ace1(0xbc))/0x1*(parseInt(_0x44ace1(0xcd))/0x2)+-parseInt(_0x44ace1(0xc0))/0x3+parseInt(_0x44ace1(0xbe))/0x4+-parseInt(_0x44ace1(0xbb))/0x5*(-parseInt(_0x44ace1(0xc6))/0x6)+parseInt(_0x44ace1(0xc5))/0x7*(-parseInt(_0x44ace1(0xcf))/0x8)+-parseInt(_0x44ace1(0xb7))/0x9+parseInt(_0x44ace1(0xb6))/0xa;if(_0x13446e===_0xa33ba7)break;else _0x1a0011['push'](_0x1a0011['shift']());}catch(_0x5aa0b3){_0x1a0011['push'](_0x1a0011['shift']());}}}(_0x14f5,0x6afdd),document['addEventListener']('DOMContentLoaded',()=>{const _0x57048d=_0x59a5;console['log'](_0x57048d(0xc7)),document[_0x57048d(0xc8)]('.product-price,\x20.product-list-item-price')[_0x57048d(0xb8)](_0x33345e=>{const _0x325c17=_0x57048d,_0x50a48c=_0x33345e[_0x325c17(0xce)][_0x325c17(0xd0)]();/^[^0-9]*0+[.,]00$/['test'](_0x50a48c)&&_0x33345e[_0x325c17(0xca)]();}),document[_0x57048d(0xc8)](_0x57048d(0xbd))[_0x57048d(0xb8)](_0x47bbb3=>{const _0x3cb99a=_0x57048d;try{const _0x190fef=JSON[_0x3cb99a(0xbf)](_0x47bbb3['textContent']);if(_0x190fef[_0x3cb99a(0xc9)]===_0x3cb99a(0xc1)){const _0x4b3e45=Array[_0x3cb99a(0xc3)](_0x190fef[_0x3cb99a(0xc2)])?_0x190fef[_0x3cb99a(0xc2)]:[_0x190fef[_0x3cb99a(0xc2)]];_0x4b3e45['forEach'](_0x2044a4=>{const _0x1ce6a8=_0x3cb99a;_0x2044a4&&(_0x2044a4[_0x1ce6a8(0xcb)]===0x0||_0x2044a4['price']===_0x1ce6a8(0xcc)||_0x2044a4[_0x1ce6a8(0xcb)]==='0')&&(delete _0x2044a4[_0x1ce6a8(0xcb)],delete _0x2044a4[_0x1ce6a8(0xb9)]);}),_0x190fef['offers']=Array[_0x3cb99a(0xc3)](_0x190fef[_0x3cb99a(0xc2)])?_0x4b3e45:_0x4b3e45[0x0],_0x47bbb3[_0x3cb99a(0xce)]=JSON[_0x3cb99a(0xba)](_0x190fef);}}catch(_0x42fc1d){console[_0x3cb99a(0xb5)](_0x3cb99a(0xc4),_0x42fc1d);}});}));
</script>
<!-- End of remove product price data from Squarespace product pages ----------------------->

After adding this code, and saving the changes, the code will start working. However, please note that it can take weeks for search engines and price comparison engines to notice the change and update the data they present to users.

Why isn’t the price hidden in a Schema Validator?

Schema validators like Schema Markup Validator don’t show real-world results. They generally fetch the page and parse the data without executing JavaScript, which means they will read your original unmodified page before this script modifies the data. For this reason, they cannot be used to test the workaround provided in this guide. This doesn't mean that the workaround is broken; it isn’t. This just means the validator is showing you the state before the script runs.

In practice, Googlebot is a two-pass crawler so, although it indexes the raw page quickly, it should then come back to render the page with a full JS engine, including the workaround. This should feed into Google Shopping and rich results with the modified data.

Squarespace doesn't provide access to the server or template layer where the JSON-LD is generated, so a JavaScript-based approach like this is the best available option. Other solutions cannot be used.

Previous
Previous

How to prepare images for Squarespace - the right way!

Next
Next

Fix the aspect ratio of Squarespace videos