Custom templates in Shopify are a great way to enhance the look and functionality of your store by applying unique designs to specific products, pages, or collections. However, there may come a time when you no longer need these custom templates, and deleting them can help keep your store’s theme files clean and manageable.
In this blog post, we’ll guide you through the process of deleting custom template layouts for both OS 1.0 (Liquid-based) and OS 2.0 (JSON-based) Shopify themes. Understanding how templates are structured in each type of theme will help you manage them more effectively.
Deleting Custom Templates in Shopify OS 2.0 Themes
In Shopify OS 2.0 themes, Shopify introduced a new system where the layout and template files are primarily JSON-based. These JSON files dictate the layout of pages and products, allowing for more flexible customization and dynamic content sections.
Steps to Delete Custom JSON Layouts in OS 2.0:
-
Log in to Shopify Admin: Start by logging into your Shopify store’s admin dashboard.
-
Navigate to Themes: On the left-hand menu, click "Online Store" and then select "Themes".
-
Edit Your Theme Code: Next to your live theme (or the theme you want to edit), click on the "Actions" button and select "Edit code."
-
Locate the JSON Layout in the Templates Folder:
- In OS 2.0 themes, template layouts are stored as JSON files in the "Templates" folder.
- Look for files such as:
product.custom-template.json
page.custom-template.json
collection.custom-template.json
- Each of these files corresponds to a custom template for different parts of your Shopify store.
-
Delete the Custom JSON Template:
- Once you find the custom template you wish to remove, click on it to open the file.
- Click the "Delete file" button at the top of the editor to permanently delete the template.
-
Check the Sections Folder (if necessary):
- If your custom layout uses specific sections that were only created for that template, you can also delete these by navigating to the "Sections" folder.
- Custom sections might be named something like
custom-section.liquid
. Deleting them will clean up your theme further.
-
Save and Test:
- After deleting the template, ensure that no products, pages, or collections are using the deleted template. If necessary, assign them to different templates to avoid any errors.
Important Notes for OS 2.0:
- JSON-based templates control layout, but reusable sections in these templates are coded in Liquid.
- Make sure that the template you delete is not actively in use before removing it to avoid impacting live pages.
Deleting Custom Templates in Shopify OS 1.0 Themes
In OS 1.0 themes, template files were primarily Liquid-based and controlled the structure and content of your pages, products, and collections. While these themes are still supported, they function differently from OS 2.0, and custom templates are handled in a slightly different manner.
Steps to Delete Custom Liquid Layouts in OS 1.0:
-
Log in to Shopify Admin: Log in to your Shopify store’s admin dashboard.
-
Go to Themes: On the left-hand side, click "Online Store" and then "Themes."
-
Edit Your Theme Code: Click "Actions" next to your theme and select "Edit code."
-
Find the Liquid Template in the Templates Folder:
- In OS 1.0 themes, the template files are stored in the "Templates" folder, typically using the
.liquid
extension. - Custom templates will look like:
product.custom-template.liquid
page.custom-template.liquid
collection.custom-template.liquid
- In OS 1.0 themes, the template files are stored in the "Templates" folder, typically using the
-
Delete the Custom Liquid Template:
- Find the specific template you want to delete, click on it to open the file, and click the "Delete file" button at the top of the editor.
-
Check for Related Sections (if applicable):
- If the custom template uses unique sections (located in the "Sections" folder), consider deleting these as well if they are no longer needed.
-
Save and Test:
- Similar to OS 2.0, after deleting the custom template, make sure that no live products or pages are assigned to it. Reassign them to default templates if necessary.
Important Notes for OS 1.0:
- Custom templates in OS 1.0 are Liquid-based and work similarly to sections, allowing you to create specific layouts for different store elements.
- Deleting the wrong template can result in broken layouts, so make sure you know which templates are in use.
Final Thoughts
Managing custom template layouts in Shopify is an important part of keeping your theme files organized and ensuring a smooth user experience. Whether you’re using an OS 1.0 or OS 2.0 theme, understanding how to delete these templates will help you avoid clutter and potential errors in your store.
For OS 2.0 themes, the switch to JSON files makes managing layouts much more flexible, while OS 1.0 themes continue to use Liquid templates that are still widely used.
Before deleting any template, always ensure it’s not currently in use by live products or pages to prevent disruptions on your store. As always, test after making changes to your theme files to confirm everything is working as expected.
Have any questions about deleting custom templates in Shopify? Feel free to reach out!