Squarespace URL Queries
What are URL queries?
URL queries are the portion of a URL that follows a question mark [?]. They can also be called URL parameters, query strings or URL variables. When added to a Squarespace URL, they pass information to Squarespace to request additional information. Many of these queries are undocumented, so hereβs our guide to them.
In the examples that follow, weβve used your-site.squarespace.com as the siteβs built-in domain name. As this site doesnβt exist, youβll want to replace this with your siteβs built-in domain name.
In addition to URL queries, Iβve included some βpathsβ - the part of the URL that follows the domain name. For example /config.
Filter by tag
You can filter a product, gallery or blog page to show only the items that have been tagged with a specific tag. For example, if your store page has the URL /store and you only want to show products tagged with βblueβ, you can use this URL query:
Please note that URL queries are case sensitive, so if products are tagged βblueβ this will work, but if they are tagged βBlueβ it wonβt return any results.
Filter by category
You can filter a product, gallery or blog page to show only the items that have been categorised with a specific category. This works in exactly the same way as tagging above, except the query is category instead of tag. For example, if your store page has the URL /shop and you only want to show products categorised as βTopsβ, you can use this URL query:
Viewing your site without logging on
When testing your website, itβs a good idea to view it when not logged in. This is because when you are logged on the website preview is not entirely accurate. It runs in an iFrame with some features like Ajax Page Loading (v7.0) and Code Block script disabled. You can usually do this in a private/incognito browser window, but if you are automatically logged in (your URL includes /config/) you can use the noredirect query to prevent the site from being redirected to the login. To do this, type your domain name into the browser and add ?noredirect to the URL, like this:
Automatically enter the site-wide password
You can hide your site behind a password to prevent it from being publicly accessible. If you need to share your password-protected site with clients and want to make it easier for them to open the site without typing the password, you can include the ?password URL query. For example, if the site-wide password is βdemoβ and your built-in domain is https://your-site.squarespace.com and your homepage has the URL β/homeβ, you can share the URL below. When this URL is clicked, the user will be able to view the site, despite the password.
View JSON
Every Squarespace website is created in JSON-T. You can view a βhuman-readableβ form of the JSON behind any Squarespace page by using the query ?json-pretty (as shown below). It is also possible to use ?format=json but this is more suitable for data processing as it isnβt very readable.
View CSS
To view the CSS being used on a Squarespace site, use the following query:
RSS Format
You can show a pageβs collection data in RSS format using the following query. Note that this works for collections (such as blogs) not for standard pages.
Main content format
You can generate the HTML of the main content of a page (without CSS) by using the URL query below. Note that this is suitable for standard pages, not collections.
Edit a Squarespace site
To edit a Squarespace site, use the config path:
Extend a Squarespace trial
This is also a path rather than a query, but itβs a very useful shortcut to extend a Squarespace trial:
Safe Mode - Prevent code loading
You can put your site into a "safe mode" that prevents custom code from loading by adding "/safe". This is useful for troubleshooting a site to see if custom code is causing an issue.
Smaller images
If you are loading an image from Squarespace you can use a URL query to specify the width of the image in pixels to download a smaller version of the image.
When you add an image to Squarespace, the platform automatically creates up to seven versions of that image, each with a different width. If your image is larger than 2500 pixels wide, it will create versions with the following widths:
100 pixels
300 pixels
500 pixels
750 pixels
1000 pixels
1500 pixels
2500 pixels
The imageβs aspect ratio will always be preserved because the height will change relative to the width. Squarespace's built-in responsive design should always pick the most appropriate image size based on the visitor's screen width and pixel density, but if you are manually loading an image into code or to another site such as Instagram or Facebook then you may want to control the image size.
For example, if you specify an image URL like the one below, the original version of the image should appear:
https://images.squarespace-cdn.com/content/v1/5d37161e0198630001386071/1564673273407-NI2Z1YS7KDZU0UA65IOJ/1509-10f-01_Watches_Details_0068-RGB.jpg
However, if you add a URL query of ?format=1500w you can download a version of the image that is only 1500 pixels wide:
https://images.squarespace-cdn.com/content/v1/5d37161e0198630001386071/1564673273407-NI2Z1YS7KDZU0UA65IOJ/1509-10f-01_Watches_Details_0068-RGB.jpg?format=1500w
Or you could use ?format=100w to view a version that is only 100 pixels wide:
https://images.squarespace-cdn.com/content/v1/5d37161e0198630001386071/1564673273407-NI2Z1YS7KDZU0UA65IOJ/1509-10f-01_Watches_Details_0068-RGB.jpg?format=100w