Colection is written with each h1 on shopify page
- User
Colection is written with each h1 on shopify page
- Assistant
It looks like you're trying to add multiple
<h1>tags on a Shopify page, possibly to display different collections or sections, but you mentioned "Colection" is "written with each h1", which might mean:- You want each collection title wrapped in an
<h1>, or - You're seeing the word "Colection" inside each
<h1>, or - You're encountering repeated
<h1>tags and wondering if this is correct or how to do it properly.
Important Notes About
<h1>Usage- For SEO and semantic HTML, it’s best practice to have only one
<h1>per page, ideally representing the main page title. - Subsequent headings should be
<h2>,<h3>, etc., to maintain a proper document outline.
How to Show Multiple Collection Titles on a Shopify Page Properly
If you want to list multiple collection titles, here's how you can approach it:
1. Use one main
<h1>for the page titleFor example:
liquid<h1>All Collections</h1>2. Use
<h2>for each collection titleExample snippet for a Shopify page template:
liquid<h1>All Collections</h1> <ul> {% for collection in collections %} <li> <h2> <a href="{{ collection.url }}">{{ collection.title }}</a> </h2> </li> {% endfor %} </ul>
If you want each collection’s heading on separate pages
On the individual collection page (template:
collection.liquidorcollection.json.liquid), normally you use:liquid<h1>{{ collection.title }}</h1>There should be only one
<h1>per page.
Summary / Best Practice
- Only one
<h1>per page. - Use
<h2>,<h3>, etc., for subheadings. - Ensure that the word "Collection" is spelled correctly.
- If you want to change the default "Collection" heading or style multiple headings, do so with
<h2>or smaller headings.
Example of a correct multi-collection list on a Shopify page:
liquid<h1>Shop Our Collections</h1> {% for collection in collections %} <div class="collection-item"> <h2>{{ collection.title }}</h2> <a href="{{ collection.url }}"> <img src="{{ collection.image | img_url: 'medium' }}" alt="{{ collection.title }}"> </a> </div> {% endfor %}
If you want me to help you fix or create a specific Shopify section or page, please share your current code or explain your need in more detail!
- You want each collection title wrapped in an
- User
I want to remove that collection from each h1
- Assistant
Got it! You want to remove the word "Collection" from each
<h1>tag on your Shopify page.This usually happens because Shopify or your theme outputs something like:
html<h1>{{ collection.title }}</h1>and your collection titles contain the word "Collection", e.g., "Summer Collection".
How to remove or modify "Collection" from each
<h1>Option 1: Edit Collection Titles in Shopify Admin
If possible, edit your Collection titles in Shopify admin by removing the word "Collection" from the title itself.
- Go to Products > Collections
- Edit the collection title and remove the word "Collection"
Option 2: Modify liquid code to remove or replace "Collection" text dynamically
If you can't or don't want to edit collection titles manually, you can modify the liquid code to strip or replace the word "Collection" from displaying in an
<h1>.Example using Liquid’s
replacefilter:liquid<h1>{{ collection.title | replace: "Collection", "" | strip }}</h1>- This replaces the word
"Collection"with an empty string. - The
stripfilter removes any extra whitespace.
If your collection title is
"Summer Collection"
This will output<h1>Summer</h1>.
Example code snippet for a collection page
liquid<h1>{{ collection.title | replace: "Collection", "" | strip }}</h1>
Option 3: Advanced - Remove word regardless of case
If you want to remove "collection" regardless of uppercase or lowercase letters (case-insensitive), Liquid filters alone don’t support regex or case-insensitive replacements, but you can chain replacements:
liquid<h1> {{ collection.title | replace: "Collection", "" | replace: "collection", "" | strip }} </h1>
Summary
- Find the template that outputs
<h1>{{ collection.title }}</h1>. Usuallycollection.liquidor a section likecollection-template.liquid. - Replace the line with:
liquid<h1>{{ collection.title | replace: "Collection", "" | strip }}</h1>- Save, check your storefront: the
<h1>will no longer have the word "Collection".
If you’re not sure where to find the template or want me to help edit your code, please share your current heading code or template!