How can I disable automatic collections page on my ecommerce site?

Solved

How can I disable automatic collections page on my ecommerce site?

mystore6
Tourist
5 1 0

I am currently working on setting up my Shopify store and would like to create a website with just a homepage for now. I don't want users to be able to access the collections or product pages that are automatically created by Shopify.

Could you please provide guidance on how I can disable or restrict access to these specific pages? I want to create a simple and streamlined experience where visitors can only navigate through the homepage.

Accepted Solution (1)
mystore6
Tourist
5 1 0

This is an accepted solution.

also I had the same problem with reloading unlimitedly 
but I found another solution. this code works for me

{% case template %}
  {% when 'index' %}
    <script>
      console.log('index');
    </script>
  {% when 'page.contact' %}
    <script>
      console.log('contact'); 
    </script>
  {% else %}
    <script>
      window.location.href = '/';
    </script>
{% endcase %}

 

Thanks!

View solution in original post

Replies 8 (8)

laddisahsi
Shopify Partner
385 38 41

@mystore6 

You can remove it from the navigation >> main menu.


If this solution is worked, then please Like this and Mark this as accepted solution!


Laddi



-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
mystore6
Tourist
5 1 0

Yes, you are correct that removing them from the menu hides them from easy navigation, but they are still accessible through direct URLs. If a user manually enters 'myshop.com/collections' in the browser, the corresponding page can still be accessed. I am looking for a solution that not only removes them from the menu but also restricts direct access via URLs to ensure a more controlled and streamlined browsing experience.

laddisahsi
Shopify Partner
385 38 41

@mystore6 

You can follow the following steps:

1. Please remove the width from the html.
2. Please go to the Online Store.
3. Then Edit Code.
4. Please find the theme.liquid file.
5. Please add code before closing the tag </head> tag.

{% if template != 'index' %}
<script>
 window.location.href = '/';
</script>
{% endif %}

 

If this solution is worked, then please Like this and Mark this as accepted solution!


Laddi

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
mystore6
Tourist
5 1 0

thanks for your answer. it works but I have another question. If I want to have homepage and one another page called contact, I wrote this code 

{% if template != 'index'  ortemplate != 'page'%}
<script> window.location.href = '/'; </script>
{% endif %}



is it true? for me it causes unlimited reloading page.

laddisahsi
Shopify Partner
385 38 41

{% if template != 'index' or template != 'page.contact'%}

-Shopify website development, Theme & App Development
-Contact me: WhatsApp


-Email Me
-If this solution is worked, then please Like this and Mark this as accepted solution!
mystore6
Tourist
5 1 0

This is an accepted solution.

also I had the same problem with reloading unlimitedly 
but I found another solution. this code works for me

{% case template %}
  {% when 'index' %}
    <script>
      console.log('index');
    </script>
  {% when 'page.contact' %}
    <script>
      console.log('contact'); 
    </script>
  {% else %}
    <script>
      window.location.href = '/';
    </script>
{% endcase %}

 

Thanks!

AishaMushtaq
Tourist
7 0 1

1. **Password Protect Your Store:**
- Enable password protection in Shopify settings.

2. **Customize Navigation:**
- Create a custom menu without links to collections or product pages.

3. **Modify Theme Templates:**
- Edit theme code to hide sections related to collections and products.

4. **Test Setup:**
- Preview your store to ensure only the homepage is accessible.

5. **Launch Your Store:**
- Remove password protection when you're ready to make your store public.

AishaMushtaq
Tourist
7 0 1

Certainly! To achieve a setup where visitors can only navigate through the homepage and not access the default collections or product pages in your Shopify store, you can follow these steps:

### Step 1: Password Protect Your Store
1. **Login to your Shopify Admin:**
- Go to [Shopify](https://www. shopify. com/) and log in to your account.

2. **Navigate to Online Store Settings:**
- In your Shopify admin, go to "Online Store" and then "Preferences."

3. **Enable Password Protection:**
- Scroll down to the "Password protection" section.
- Check the box that says "Enable password" and set a password for your store.

4. **Save Changes:**
- Save your changes.

### Step 2: Customize Navigation
1. **Create a Custom Navigation Menu:**
- Go to "Online Store" and then "Navigation" in your Shopify admin.
- Create a custom menu that includes only the links you want on your homepage.

2. **Remove Unwanted Links:**
- Remove any links to collections or product pages from your navigation menu that you don't want users to access.

3. **Assign the Menu:**
- In the "Theme" settings, assign your custom menu as the main menu.

### Step 3: Modify Theme Templates
1. **Access Theme Code:**
- In your Shopify admin, go to "Online Store" and then "Themes."
- Click on "Actions" and then "Edit code."

2. **Modify liquid Files:**
- Locate the liquid files responsible for displaying collections and products (commonly found in the "Sections" or "Templates" folder).

3. **Hide Unwanted Sections:**
- Comment out or remove the sections of code that render the links to collections or products.

4. **Save Changes:**
- Save your changes.

### Step 4: Test Your Setup
1. **Preview Your Store:**
- Before making your store live, use the "Preview" option to see how your changes affect the user experience.

2. **Check Navigation:**
- Test the navigation to ensure users can only access the content you want them to see.

### Step 5: Launch Your Store
1. **Remove Password Protection:**
- Once you're satisfied with your homepage setup, go back to "Online Store" > "Preferences" and disable the password protection.

2. **Make Your Store Live:**
- Your store is now accessible to the public.

Please note that modifying theme code requires some technical knowledge. If you're not comfortable doing this yourself, consider reaching out to a Shopify expert or developer for assistance. Always make a backup of your theme before making significant changes.