Home > Shopify Development > Comment Syntax How to Comment Out Liquid Code

How to comment out liquid code in Shopify

Sam Nguyen
Sam Updated: June 30, 2024

Share:

Drive 20-40% of your revenue with Avada
avada email marketing

Liquid template is popular for website developers in Shopify. Your online store wants to activate comment section on Liquid platform so that you can see customers’ questions or feedback. In today tutorial, we will introduce you to comment out liquid code.

Table of content

General information about Liquid

Liquid is an open-source templating language that support the functionality of HTML which you can use to upload dynamic content. Liquid is classified into objects, tags and filters. Objects indicates where Liquid shows content. Tags create the logic and control flow of a website. The output of a Liquid object which is separated by a slash can be changed with filters.

What is comment syntax

In general, tag markup does not allow to change the content of the text and is surrounded by a pair of curly braces and percent signs. There are two types of tags: comments and raw. Tags are usually used to apply logic to your template. You are able to use tags if/else statements to have a single template send out emails in multiple languages. Comment and raw tags are used in a case statement.

How to comment out liquid code

This tutorial focuses on comment tag. Comment enables you to leave un-rendered code inside a Liquid template. It means that visitors can copy and edit comments. Any text within the opening and closing comment blocks will not be generated and any Liquid code within not be executed.

For instance, you want to create blank space for visitors to leave their comments, then you use `` like this:

Input


Anything you put between {% comment %} and {% endcomment %} tags
is turned into a comment.

Output


Anything you put between  tags
is turned into a comment.

Conclusion

In conclusion, comment tags help you to increase your website interface with customers. Visitors can leave their comments about your products or ask for further information, hence you would instantly answer these comments. We hope that the tutorial is helpful and if you have any difficulties, let’s us know and we will support you.


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.

Stay in the know

Get special offers on the latest news from AVADA.