How to change "item added to your cart" h2 to paragraph on shopify

Hey so I noticed there’s an H2 for text that I don’t even see on the page. How do you change this to paragraph?

This is on all product pages. I pretty sure it’s not good SEO. “Item added to your cart” as the first heading? This is an example page: Professional Rap Beats for Sale | 120+ Hip Hop Beats

Any help would be greatly appreciated, again, I am just trying to change the heading to paragraph

so the product pages index better. Thanks

Hi @mlane9 Hi, I checked the code and it’s inside the class “cart-notification__header”.

Since I don’t have permissions, it’s difficult to verify the exact steps, but usually the fix is to change the H2 tag to a div or p tag.

:stop_sign: Don’t forget to back up your theme before making any changes.

  • To access the code: Online Store → Themes → Edit code.
  • Use the search bar to locate the files that control the cart notification. (For the Taste theme, a common location is: snippets/cart-notification.liquid.)
  • Open the file and search for: Item added to your cart
  • Edit the HTML, change the H2 tag to a div or p, depending on your preference.
  • Save and reload your storefront to confirm the changes.

Hope this helps! :+1:

1 Like

Hey so I see it here:

What do I change the line to?

Right now it reads:

    <h2 class="cart-notification__heading caption-large text-body">{%- render 'icon-checkmark' -%} {{ 'general.cart.item_added' | t }}</h2>

Should it instead say

{%- render ‘icon-checkmark’ -%} {{ ‘general.cart.item_added’ | t }}

Sorry, should it instead say

{%- render ‘icon-checkmark’ -%} {{ ‘general.cart.item_added’ | t }}

I think I got it to work thanks

Hey @mlane9,

In order to change the heading tag to the paragraph tag you need to replace the current line:

    <h2 class="cart-notification__heading caption-large text-body">{%- render 'icon-checkmark' -%} {{ 'general.cart.item_added' | t }}</h2>

With this new one:

    <p class="cart-notification__heading caption-large text-body">{%- render 'icon-checkmark' -%} {{ 'general.cart.item_added' | t }}</p>

In the above one code I change the h2 code to Paragraph tag exactly what you are looking for.

Hi @mlane9, you have access to the right place, now you just need to change this line of your store:

<h2 class="cart-notification__heading caption-large text-body">{%- render 'icon-checkmark' -%} {{ 'general.cart.item_added' | t }}</h2>

to:

<p class="cart-notification__heading caption-large text-body">{%- render 'icon-checkmark' -%} {{ 'general.cart.item_added' | t }}</p>

Then save it and so the H2 has changed to a p tag as you want.

1 Like