How to Embed Testimonials on Any Website (2025 Guide)
Whether you built your site on WordPress, Squarespace, Webflow, Wix, Shopify, or raw HTML, adding a live testimonial widget works essentially the same way: you paste one line of JavaScript, and the widget renders.
This guide covers how to do it on every major platform.
The Embed Code
When you set up a testimonial widget with SocialProof, you get a snippet that looks like this:
<script src="https://cdn.socialproof.dev/widget.js" data-widget-id="YOUR_WIDGET_ID" async></script>
Paste this code wherever you want testimonials to appear. The widget loads asynchronously — it doesn’t slow your page down.
You also need a target element:
<div id="socialproof-widget"></div>
<script src="https://cdn.socialproof.dev/widget.js" data-widget-id="YOUR_WIDGET_ID" async></script>
Now let’s look at how to add this on each platform.
WordPress
Method 1: Block Editor (Gutenberg)
- Open the page or post you want to add testimonials to
- Click + to add a new block
- Search for Custom HTML
- Select Custom HTML block
- Paste your embed code
- Click Preview to verify it renders
- Publish/Update
Method 2: Classic Editor
- In the editor, click Text tab (not Visual)
- Paste your embed code where you want it to appear
- Switch back to Visual to check placement
- Update/Publish
Method 3: Widget Area (appears on all pages)
- Go to Appearance → Widgets
- Drag a Custom HTML widget to your sidebar or footer
- Paste your embed code
- Save
WordPress Page Builders (Elementor, Divi, Beaver)
In any page builder:
- Add an HTML or Code element
- Paste the embed code
- Save
Squarespace
- Open the page in the editor
- Click + to add a new block
- Search for Code
- Select Code Block
- Make sure HTML is selected (not JavaScript)
- Paste your embed code
- Apply
Note: Code Blocks require Squarespace Business plan or higher. Personal plan doesn’t support custom code.
For sitewide placement (footer):
- Go to Settings → Advanced → Code Injection
- Paste in the Footer field
- Save
Webflow
- Open your Webflow Designer
- Drag an Embed element from the panel onto your canvas
- Double-click the element to open the embed editor
- Paste your code
- Save & Publish
Webflow’s Embed element is purpose-built for this — it works cleanly and doesn’t interfere with Webflow’s rendering.
Wix
- Open the Wix Editor
- Click + (Add) in the left panel
- Go to More → Embed Code → Embed HTML
- An HTML embed block appears on your page
- Click Enter Code in the block
- Paste your embed code
- Apply
- Resize and position the block as needed
Shopify
On a Page
- Go to Online Store → Pages
- Open the page you want to edit
- Click <> (Show HTML) in the editor toolbar
- Paste your embed code in the HTML
- Save
On a Theme Section
- Go to Online Store → Themes
- Click Edit code (under Actions for your active theme)
- Open the template file (e.g.,
sections/main-page.liquidortemplates/page.liquid) - Find where you want testimonials and paste your code
- Save
On Every Page (Footer/Global)
- Go to Online Store → Themes → Edit code
- Open
layout/theme.liquid - Find
</body> - Paste your code just before
</body> - Save
Wix (Advanced: Velo)
If you’re using Wix Velo (developer mode):
$w.onReady(function () {
$w('#htmlComponent').src = 'data:text/html,' + encodeURIComponent(`
<script src="https://cdn.socialproof.dev/widget.js"
data-widget-id="YOUR_WIDGET_ID" async></script>
`);
});
Custom HTML / Static Sites
For any custom-built site:
<section class="testimonials">
<h2>What Our Customers Say</h2>
<div id="socialproof-widget"></div>
<script src="https://cdn.socialproof.dev/widget.js" data-widget-id="YOUR_WIDGET_ID" async></script>
</section>
Drop this anywhere in your HTML. Works on static sites, GitHub Pages, Netlify, or any host.
React / Next.js
import { useEffect } from 'react';
export default function Testimonials() {
useEffect(() => {
const script = document.createElement('script');
script.src = 'https://cdn.socialproof.dev/widget.js';
script.setAttribute('data-widget-id', 'YOUR_WIDGET_ID');
script.async = true;
document.body.appendChild(script);
return () => document.body.removeChild(script);
}, []);
return <div id="socialproof-widget" />;
}
Troubleshooting
Widget not showing up?
- Make sure you replaced
YOUR_WIDGET_IDwith your actual ID from the dashboard - Check browser console for JavaScript errors
- Verify the widget is set to “Published” in your SocialProof dashboard
- Make sure your approved testimonials count is > 0
Widget looks wrong on mobile?
- The widget is responsive by default
- If it’s in a constrained container, add
width: 100%to the parent element
Page builder eating my code?
- Some page builders sanitize custom HTML. Use a raw HTML/Code embed element rather than a text block.
The whole process — sign up, create widget, add embed — takes about 15 minutes. The hard part is actually getting testimonials in your widget, which takes a week or two of asking past customers.
→ Start free at SocialProof — no credit card required.