How to add an FAQ accordion to your Shopify store

An "accordion" is a great way to display the FAQ to your ecommerce store, since it allows the user to quickly and easily browse your FAQ without much scrolling. And luckily, it's simple and easy to add one to your store!

Demo

This is the first question

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin tincidunt cursus eros et porta. Sed a elit tellus. Vivamus imperdiet nunc non orci faucibus, a ornare metus ultrices. Nulla vitae sapien in sapien elementum convallis.

This is the second question

Cras varius faucibus bibendum. Curabitur sit amet arcu aliquam felis ultrices rutrum. Ut auctor neque augue, in egestas elit blandit pellentesque.

This is the third question

Suspendisse ac rutrum nibh. Praesent sit amet tempor neque. Donec sed tortor felis. Nunc eu eros urna. Nunc vulputate porta ligula id mattis. In tempus massa eu risus congue commodo. Phasellus quis sapien ac lorem suscipit feugiat.

I've made this video tutorial walking you through how to add this FAQ accordion to your Shopify store. The steps are also written below.

Step 1: Download the ZIP file of necessary assets.

Click the link above to download now. Unzip it, and then upload the 3 files inside to the "Assets" folder of your Shopify template editor. If you're not sure how to do this, watch the video above and I'll walk you through it.

Step 2: Create a new page template in your Shopify template editor

You can name it whatever you want, but I recommend something simple like "faq."

Step 3: Paste the following code at the very bottom of your new page template:

[code]<script type="text/javascript" src="{{ 'jquery_accordion.js' | asset_url }}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.accordion').accordion({
defaultOpen: 'section1',
cookieName: 'accordion_nav'
});
});
</script>
<style>
.accordion {
margin: 0;
padding:10px;
border-top:#f0f0f0 1px solid;
background: #cccccc;
text-decoration:none;
color: #000;
font-size:1em;
position:relative;
}
.accordion-open {
background:#50b3da;
color: #fff;
}
.accordion-open span {
display:block;
position:absolute;
right:3px;
top:25%;
padding:10px;
}
.accordion-open span {
background:url('{{ 'minus.png' | asset_url }}') center center no-repeat;
}
.accordion-close span {
display:block;
position:absolute;
right:3px;
top:25%;
background:url('{{ 'plus.png' | asset_url }}') center center no-repeat;
padding:10px;
}
.faqpage div.container {
padding:0;
margin:0;
}
.faqpage div.container {
max-width:100%;
padding:5px 0;
}
.faqpage div.content {
background:#f0f0f0;
margin: 0;
padding:10px;
font-size:.9em;
line-height:1.5em;
}
.faqpage div.content ul {
padding:0;
margin:0;
padding:3px;
}
.faqpage div.content p {
padding:0;
margin:3px 0 10px;
padding:3px;
}
.faqpage div.content ul li {
list-style-position:inside;
line-height:25px;
}
</style>[/code]

IMPORTANT: On the new page template you just made, find a <div> tag above the {{ page.content }} tag. Add the class "faqpage" to this div. When finished, it should look something like this (if there are other words between the quotes already, that's fine--don't remove them):

[code] <div class="faqpage">[/code]

If this is confusing, watch the video above.

Step 4: Create a new page called "FAQ." Save, then change the page to the new template.

Step 5: Paste the following code into the page:

[code]<div class="accordion" id="section1">Question 1<span></span></div>
<div class="container">
<div class="content">
<p>This is the answer to question 1.</p>
</div>
</div>
<div class="accordion" id="section2">Question 2<span></span></div>
<div class="container">
<div class="content">
<p>This is the answer to question 2.</p>
</div>
</div>
<div class="accordion" id="section3">Question 3<span></span></div>
<div class="container">
<div class="content">
<p>This is the answer to question 3.</p>
</div>
</div>[/code]

Step 6: Edit the contents to your heart's content!

Need help?

If you need help installing this feature on your site, I recommend that you post a job on Storetasker. Storetasker is a platform that will connect you with vetted Shopify developers who can give you a reasonable quote for small store updates like this.

Get help from Storetasker

Note: The Storetasker link above is an affiliate link, which means that if you hire a developer to help you install this code, I'll receive a commission at no extra cost to you. If you choose to use this affiliate link, I'm grateful for your support!

Comments (87)

Leave a comment

Best Shopify related tutorial so far! Thanks.

ArtFil

Hey Leighton,

How would I edit the code to make it so that the width the accordion takes up is not the available width, but rather a width I specify?

Sebastian Lozano

This is very easy and nice way to add FAQ on shopify site , but only if you want to add static FAQ , What if you want to add dynamic different set of FAQ to each product , Shopify Product FAQ app is very useful , have a look :
https://apps.shopify.com/product-faq

Vikash

Hi, I had a problem with getting the click function to work. Now my FAQ question shows both question and answer right away without the possibility to click/hide.

How can I fix this?

Kind regards
Brita

Brita Vonstad

Hey Sebastian, you could do this by placing the following code at the top and bottom of your existing FAQ code:

<div style="width:500px;">

[insert FAQ code here]

</div>

Just change the “500px” to whatever pixel width or percentage width (e.g., “50%”) you want.

Leighton Taylor

Hi Brita, this sounds like the script is not working correctly. I checked your site but the FAQ page seems to have been removed. If you set up the page again and then comment here with the URL, I’ll check it out and see if I can find the problem.

Leighton Taylor

Leighton,

This looks great. I am just wondering if it’s possible to change mouse cursor to a finger point when moving mouse to a Question title?

Jason

Hi Leighton,

I’m creating a number of accordions under different headings on an FAQ page and I’d like to style each accordion with different colors.

Is it possible to do this? Thanks.

Scott

Hey Leighton, thank you so much! That’s two of your tutorials I’ve followed now with success, my shop is looking great! I was wondering if there was a way so that the first question is already open/expanded by default when loading the page?

I actually implemented this to my product description and would like the fist section of ‘About’ to be open by default.

Guy

Hey Guy, that’s great—you’re very welcome! It should be showing the first one open by default, so I’m not sure why it’s not for you. Can you give me the URL of the page you’re working on so I can take a look?

Leighton Taylor
« Previous 1 2 3 4 5 9 Next »

You Might Also Like

View All Articles

61: Research-based A/B testing, with Nick Disabato

April 21, 2026

Topics covered in this episode:

  • Nick D's work, writing, tips, and tools
  • Basics of A/B testing
  • How to interview your customers to learn what needs to change on your website
  • How to know when your business is ready for A/B testing
  • Most common UX and copy mistakes to watch out for
  • Common misconceptions about A/B testing

Links mentioned on the show:

Read Article

How to add an announcement bar on your Shopify store (without an app)

August 26, 2018

Read Article