Boost Buyer Confidence: How to Add Custom Shopify Trust Badges Above Your Buy Button
Hey fellow store owners!
Ever wonder how to really nail that feeling of trust on your Shopify product pages? It’s a question that comes up a lot in the community, and recently, a fantastic discussion unfolded around exactly that: trust badges. Our friend hiten890 kicked things off, asking for a fully customizable solution – something that wasn’t just a static image, but dynamic, editable, and, crucially, could be placed strategically, like right above the "buy now" button.
We all know the drill. You want your customers to feel secure, confident, and ready to click that "Add to Cart" button without a second thought. Trust badges, whether they’re payment icons (Visa, Mastercard, PayPal), security seals (SSL, secure checkout), or even guarantees (money-back, free shipping), are visual cues that instantly convey reliability. They’re silent salespeople, whispering "you’re safe here" to your potential buyers.
While there are plenty of apps out there that can add trust badges, sometimes you want more control. You want to match your brand's aesthetic perfectly, avoid extra app bloat, or simply place them exactly where they'll have the most impact. That's precisely what hiten890 was looking for – a custom code solution that offered total flexibility from images to text.
That's where Moeed, a really helpful expert from our community, stepped in with a brilliant solution. He didn't just offer a quick fix; he provided a robust, customizable section that you can easily integrate into your Shopify theme. This approach gives you the power to manage your trust badges directly from your theme customizer, without touching code every time you want to make a change.
Moeed’s solution leverages Shopify's theme architecture using "sections" and "blocks." If you're new to theme editing, it’s good to know that a section is a customizable content area, like a header, footer, or a product information area. Inside a section, you can have blocks, which are individual content units – in this case, each trust badge image or text snippet. This structure is super powerful because it lets you add, remove, reorder, and customize individual badges with ease.
So, how do you get this fantastic, customizable trust badge section onto your product pages (or anywhere else you want, for that matter)? Moeed laid out the steps clearly, and I’m here to walk you through them.
Step-by-Step: Adding Custom Trust Badges to Your Shopify Store
- Access Your Theme Code: From your Shopify admin, go to Online Store > Themes. Find the theme you want to edit (it’s always a good idea to duplicate your theme first if you’re making code changes!), click Actions > Edit code.
- Create a New Section File: In the left-hand sidebar, under the "Sections" directory, click Add a new section. Name the file
trust-badges.liquidand click "Done." - Paste the Code: Now, copy the entire code block provided by Moeed below and paste it into your newly created
trust-badges.liquidfile, replacing any default content that might be there. - Save Your Changes: Click "Save" in the top right corner.
- Add the Section to Your Theme: Go back to your Shopify admin, then Online Store > Themes > Customize (for your active theme).
- Integrate the Trust Badges: Navigate to the product page template (or any template where you want the badges to appear). In the left sidebar, click Add section. You should now see "Trust badges" listed under the available sections. Click to add it.
- Customize Your Badges: Once added, you can click on the "Trust badges" section in the customizer sidebar. Here's where the magic happens:
- You can add a Heading text, adjust its size and color.
- Set the Background color and Vertical padding.
- Control the Heading alignment and Badge alignment (left, center, right).
- Adjust the Space between badges.
- To add individual badges, click Add badge under the section settings. For each badge block, you can upload an image, provide fallback text/alt text, and set its height.
Here’s the powerful Liquid code Moeed shared that makes all this possible:
{%- if section.settings.heading != blank -%}
{{ section.settings.heading }}
{%- endif -%}
{%- for block in section.blocks -%}
{%- if block.settings.image != blank -%}
{%- else -%}
{{ block.settings.label }}
{%- endif -%}
{%- endfor -%}
{% schema %}
{
"name": "Trust badges",
"settings": [
{ "type": "text", "id": "heading", "label": "Heading text", "default": "Guaranteed safe checkout" },
{ "type": "range", "id": "heading_size", "label": "Heading size", "min": 10, "max": 32, "step": 1, "unit": "px", "default": 14 },
{ "type": "color", "id": "text_color", "label": "Text color", "default": "#444444" },
{ "type": "color", "id": "bg", "label": "Background", "default": "#ffffff" },
{ "type": "select", "id": "alignment", "label": "Heading alignment", "options": [ { "value": "left", "label": "Left" }, { "value": "center", "label": "Center" }, { "value": "right", "label": "Right" } ], "default": "center" },
{ "type": "select", "id": "flex_align", "label": "Badge alignment", "options": [ { "value": "flex-start", "label": "Left" }, { "value": "center", "label": "Center" }, { "value": "flex-end", "label": "Right" } ], "default": "center" },
{ "type": "range", "id": "gap", "label": "Space between badges", "min": 0, "max": 40, "step": 2, "unit": "px", "default": 12 },
{ "type": "range", "id": "padding_y", "label": "Vertical padding", "min": 0, "max": 60, "step": 2, "unit": "px", "default": 16 }
],
"blocks": [
{ "type": "badge", "name": "Badge", "settings": [
{ "type": "image_picker", "id": "image", "label": "Badge image" },
{ "type": "text", "id": "label", "label": "Fallback text / alt", "default": "Secure payment" },
{ "type": "range", "id": "height", "label": "Image height", "min": 16, "max": 80, "step": 2, "unit": "px", "default": 32 }
] }
],
"max_blocks": 12,
"presets": [ { "name": "Trust badges", "blocks": [ { "type": "badge" }, { "type": "badge" }, { "type": "badge" }, { "type": "badge" } ] } ]
}
{% endschema %}
And here’s a peek at what it looks like in action and in the customizer, thanks to Moeed’s screenshots:
This custom section is a fantastic way to enhance your product pages without relying on external apps for every little thing. You get full control over the look, feel, and placement, ensuring your trust badges align perfectly with your brand and conversion strategy. And because it's a section, you can drag and drop it wherever you need it within your theme customizer – making it super easy to place it right above that "buy now" button, just like hiten890 wanted!
It’s always inspiring to see the community come together to solve these common e-commerce challenges. A big shout-out to Moeed for sharing such a valuable and well-explained solution. This kind of collaborative problem-solving is what makes the Shopify community so powerful. So, if you've been looking for a way to add highly customizable trust badges to your store, give this method a try. It’s a powerful step towards building more confidence and driving more sales on your site. Happy selling!

