To access specific collection attributes, you must know collection handle and use this kind of code :

{{ collections['the-handle'].url }}

So to achieve what you want to do, here is what you could do:

{% assign collection_handle = 'the-handle-of-collection-you-want' %}
{% for product in collections[collection_handle].products %}
    Do your stuff
{% endfor %}

Note that you cannot access a collection through its title. Only handle.

Learning more about what's handle: https://help.shopify.com/themes/liquid/basics/handle

HTH

Answer from Alice Girard on Stack Overflow
🌐
Shopify
shopify.dev › docs › api › liquid › objects › collection
Liquid objects: collection
The handle of the collection. ... The ID of the collection. ... The image for the collection. This image is added on the collection's page in the Shopify admin.
Discussions

How to Change the URL Handle of the "All" Collection through Code in Shopify?
Hello everyone, I would like to change the URL handle of the “All” collection on my Shopify store from mysite.com/collections/all to something more descriptive, like mysite.com/collections/everything. I want to do this through my Shopify theme’s code. I’ve searched for the collection.liquid ... More on community.shopify.com
🌐 community.shopify.com
1
September 8, 2023
Why is the collection handle included by default in products URL if it is bad for SEO?
Hi, The product cards includes a line of code such as this one to determine its url structure: data-product-url="{{ product.url | within: collection }}" Depending, it generates urls as: domain.com/collections/collection-handle-1/products/product-handle domain.com/collections/collection-han... More on community.shopify.com
🌐 community.shopify.com
1
1
April 11, 2024
Loop through a collection using a collection ID
Hi there, Trying to figure out how to loop through a collection using the collection ID. Is this possible? Right now I’m using the collection name, ie: collections['collection-name'].products but needing to transition away from that since the collection name can change over time. More on community.shopify.com
🌐 community.shopify.com
0
May 15, 2023
How to target a specific collection page on shopify
Hello, so I’m having trouble with targeting a specific collection page on my shopify website. Here’s some context: My clients website has 3 specific pages for selling their clothing: a men’s page, women’s page, and petite page. As part of my work (web design), I’m adding a image to ... More on community.shopify.com
🌐 community.shopify.com
0
May 26, 2024
🌐
HulkApps
hulkapps.com › home › shopify hub › a complete guide on how to get collection handle in shopify
A Complete Guide on How to Get Collection Handle in Shopify
April 11, 2024 - A collection handle in Shopify is a unique, URL-friendly identifier assigned to each collection within your store. It facilitates accessing and manipulating specific collections through Liquid, Shopify's templating language.
🌐
Entaice
entaice.com › blog › shopify-liquid-get-collection-by-handle
How to Fetch Collections in Shopify Using Liquid's Handle | Entaice
September 7, 2023 - So, for instance, if you have a collection named “Summer Vibes”, its handle will most likely be ‘summer-vibes’. Cool, right? Shopify uses this approach to make it easy for us (and the URLs) to keep track of different collections without breaking a sweat.
🌐
Shopify Community
community.shopify.com › technical q&a
How to Change the URL Handle of the "All" Collection through Code in Shopify?
Hello everyone, I would like to change the URL handle of the “All” collection on my Shopify store from mysite.com/collections/all to something more descriptive, like mysite.com/collections/everything. I want to do this through my Shopify theme’s code. I’ve searched for the collection.liquid ...
Published   September 8, 2023
Find elsewhere
🌐
Shopify Community
community.shopify.com › shopify discussion
Loop through a collection using a collection ID
May 15, 2023 - Hi there, Trying to figure out how to loop through a collection using the collection ID. Is this possible? Right now I’m using the collection name, ie: collections['collection-name'].products but needing to transition a…
🌐
Shopify Community
community.shopify.com › store design
How to target a specific collection page on shopify
May 26, 2024 - Hello, so I’m having trouble with targeting a specific collection page on my shopify website. Here’s some context: My clients website has 3 specific pages for selling their clothing: a men’s page, women’s page, and petite page. As part of my work (web design), I’m adding a image to ...
🌐
Shopify
shopify.dev › docs › api › admin-graphql › latest › queries › collectionbyhandle
collectionByHandle - GraphQL Admin
query { collectionByHandle(handle: "there is no collection with a handle like this") { id title products(first: 5, reverse: true) { edges { node { id title createdAt priceRangeV2 { minVariantPrice { amount currencyCode } maxVariantPrice { amount currencyCode } } } } } } } curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { collectionByHandle(handle: \"there is no collection with a handle like this\") { id title products(first: 5, reverse: true) { edges { node { id title createdAt priceRangeV2 { minVariantPrice { amount currencyCode } maxVariantPrice { amount currencyCode } } } } } } }" }'
🌐
Shopify Help Center
help.shopify.com › en › manual › products › collections › collection-layout
Shopify Help Center | Collection layout and appearance
Tap the collection name, and then enter a new name for your collection. ... From your Shopify admin, go to Products > Collections.
🌐
Shopify Community
community.shopify.com › store design
How to add custom line item property based on collection type?
August 10, 2023 - I have done so successfully and it is showing, but I cannot seem to make it render based on collection type. For example: {% if collection.handle == 'shopify' %} The first line of code is the issue, but every variation I try does not work. If I do it based on product handle it works.
🌐
Shopify Community
community.shopify.com › technical q&a
How can I add a second description to each collection bottom?
Hi! I would like to add a second description at the bottom of each collection. The description will be different for each collection. How can I do this? I’m using Impulse Impulse v.1.0 For example this is a collection page that I would like to add a second description below the products ...
Published   January 15, 2023
🌐
Inso
inso.codes › post › shopify-handle-what-is-it-and-how-to-manage-it
Shopify Handle: What is it and how to manage it
September 8, 2024 - A Shopify handle is a URL-friendly version of a name used to identify resources such as products, collections, and pages within your Shopify store. It typically consists of lowercase letters, numbers, and hyphens.
🌐
Replo
replo.app › blog › shopify-collections
Replo Blog - Shopify Collections: What Are They And How To Use Them
September 12, 2025 - You group related products onto the same page so shoppers can find the right thing fast, which is key to a smooth user experience. Many top ecommerce brands, such as Tushy and Simple Modern, use collections pages to organize their extensive product catalogs, which can number from the tens to the hundreds. What is a Shopify collections page?
🌐
Matrixify App
matrixify.app › home › how to bulk add and remove products in shopify custom/manual collections
How to add products to Shopify custom collections - Matrixify App
November 27, 2023 - But if defining rules for Smart Collection seem too complicated, or you need to have more than 5000 collections, then Custom Collections are a way to go. Shopify has a limit of 5000 Smart Collections, but no limit on Custom Collections. In a Custom Collection, products are added manually by Product ID or Product Handle.
🌐
Avada
avada.io › home › shopify › shopify devdocs › how to create a collection-aware product url in shopify
How to Create a Collection-aware product URL in Shopify
February 25, 2025 - A collection-aware product URL is created by prepending /collections/collection-handle to a product URL.
🌐
GemPages
help.gempages.net › home › change the url handle of your page
Change the URL Handle of your Page - Help Center
October 14, 2025 - Step 1: Go to Shopify Admin > Products > All products or Shopify Admin > Products > Collections and then select your preferred one. Step 2: Under the Search engine listing preview section, click on “Edit website SEO.” · Enter your preferred ...