Remove one word from product title in collection pages

Hi there,

We have some pretty long titles to our products, I managed to shorten the product titles in collection pages . (important is that the title in the product page to remain the same)

Example:

Before: IPHONE 13 PRO MAX CASE, ALLIGATOR LEATHER

After: IPHONE 13 PRO MAX CASE

But now i want to remove the word “CASE”

I used {{ product.title | split: “,” | first }}, now what can I add to the code to remove the word “CASE” ?

@editor2

try this code. {{ product.title | remove: “case” }}

Let me know if it not working.
Thank you.

It’s not working, i need to add something to the same code {{ product.title | split: “,” | first }} to remove that word, right ?

@editor2

Use replace ,
i hope it will work.

Its not working, I already used {{ product.title | split: “,” | first }} to shorten the title, now I can’t make another line of code exactly like the first but using “remove” or “replace”.

{{ product.title | split: “,” | first }} needs something added to it to remove the word “CASE”

Hi @editor2 ,

Try this one instead

{{ product.title | replace: "CASE", "" | split: "," | first }}

@made4Uo

That’s it ! But instead I used “remove” and I needed to write “Case” not “CASE” for the code to work, but thank you anyway :slightly_smiling_face: