Solved

How to remove /collections page and /products page

inter_b2b
Tourist
5 0 1

Hi all,

I would like to remove < myshopify.com/collections > and < myshopify.com/products > page, so that even if these pages were indexed in google, no one could access and see the contents inside.

inter_b2b_1-1715808261366.png

inter_b2b_2-1715808287435.png

 

Thank you!

Accepted Solution (1)
Liqiud_xPert_SJ
Shopify Partner
804 100 128

This is an accepted solution.

Ok let me check

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂

View solution in original post

Replies 9 (9)

Liqiud_xPert_SJ
Shopify Partner
804 100 128

@inter_b2b 

 

You cannot hide them you can use a redirect for these two pages to the homepage.

 

Thanks

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂
inter_b2b
Tourist
5 0 1

@Liqiud_xPert_SJ 
Thanks so much! Could you share your knowledge on how to redirect those two pages to the homepage?

This one bothered me quite long so if there is any way to do that, that would be so helpful!!

Liqiud_xPert_SJ
Shopify Partner
804 100 128

@inter_b2b  ok hold on plz let me share

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂
Liqiud_xPert_SJ
Shopify Partner
804 100 128

<script type="text/javascript">
jQuery( document ).ready(function($) {

if (window.location.href.indexOf('?/collections/all=') > 0) {
window.location.href = '/';
}
else if (window.location.href.indexOf('?/products=') > 0) {
window.location.href = '/'; //Will take you to Google.
}
});
</script>

 

Please add this code into your theme.liquid file before the </body> tag

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂
inter_b2b
Tourist
5 0 1

Hi @Liqiud_xPert_SJ 
Thanks so much for your time. I tried both version but seems like not working 😞

inter_b2b_0-1715955845990.pnginter_b2b_1-1715955951215.png

 

Liqiud_xPert_SJ
Shopify Partner
804 100 128

Share your store url

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂
inter_b2b
Tourist
5 0 1

Hi @Liqiud_xPert_SJ  I have sent you the direct message. Thanks!

Liqiud_xPert_SJ
Shopify Partner
804 100 128

This is an accepted solution.

Ok let me check

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂
inter_b2b
Tourist
5 0 1

@Liqiud_xPert_SJ 
after adding below as you advised, it works perfectly 🙂 Thanks tremendously!


<script> let url = window.location.href; if (url.includes('/products')) { location.href = '/'; } </script>

Any chance I can do the same on /collections page?
even if not possible, I am still content on what's been accomplished so far. This is the furthest I came!! Thanks indeed.