Testimonial widget WordPress without plugin
You can add a testimonial widget to WordPress without a plugin by pasting two lines of code into a Custom HTML block. Vouchjar gives you that code and a link your customers use to send testimonials, so the page keeps itself up to date and you don't add another plugin to maintain.
<div data-vouchjar="your-wall" data-theme="auto"></div>
<script src="https://vouchjar.com/embed.js" async></script> Example quotes. Want to try the collection form as well? Use the homepage demo.
What you’re adding
Vouchjar has two halves. The collection link is a page you send to clients, where they write a few lines, pick a star rating and can add a photo. None of it goes public until you approve it. The embed is one <div> and one <script> tag that show your approved testimonials as a grid, a carousel or a single quote.
Your customers do the typing, and you approve what comes in from the Vouchjar dashboard. Once the code is on the page, you don’t have to open that page in WordPress again to add a testimonial.
Add it to WordPress in five steps
1. Create a free wall
Sign up with your email. You don’t need a password or a card. Name the wall after your site. The free plan includes one wall and five approved testimonials.
2. Collect and approve testimonials
Copy the collection link from your dashboard and send it to a few happy customers. If someone has already praised you on X or LinkedIn, paste the post into Import and Vouchjar pulls out the name and text for you to check.
Each submission arrives switched off. Tick Show on wall for the ones you want on your site.
3. Add a Custom HTML block
Open the page or post in the block editor. Click the + block inserter and search for Custom HTML, or type /html in an empty paragraph and press Enter. Put the block where the testimonials should appear.
4. Paste the embed code
Paste the code from your dashboard. It looks like this, with your wall’s ID in place of your-wall:
<div data-vouchjar="your-wall"></div>
<script src="https://vouchjar.com/embed.js" async></script>
In WordPress 7.0 and later, click Edit HTML on the block to open its editor, paste both lines into the HTML panel and click Update. Leave the CSS and JavaScript panels empty. On older versions you paste straight into the block and can check the result on its Preview tab.
5. Publish and check the live page
Click Update or Publish, then open the page in a private window. Checking while logged out shows you what visitors see.
If your role can’t save scripts
WordPress only keeps <script> tags from users with the unfiltered_html capability (see the FAQ below). If Authors or Contributors on your site need to place walls, have an administrator load the script once from your child theme’s functions.php:
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_script(
'vouchjar',
'https://vouchjar.com/embed.js',
array(),
null,
array( 'strategy' => 'async', 'in_footer' => true )
);
} );
The array of loading options needs WordPress 6.3 or later. After that, anyone can drop just the <div data-vouchjar="your-wall"></div> line into a Custom HTML block, because WordPress keeps data- attributes for every role. On pages without a wall, the script finds nothing and doesn’t fetch anything. Use a child theme for this, or a theme update will wipe the change.
Which layout suits which page
Add data-layout to the <div> to switch layouts:
| Layout | Add this | Good for |
|---|---|---|
| Grid | nothing (it’s the default) | A testimonials page using the full content width |
| Carousel | data-layout="carousel" | A homepage section or a narrow sidebar |
| Single | data-layout="single" | Next to a pricing table or a booking button |
If your theme has a dark background, add data-theme="dark" to the <div>, or data-theme="auto" to follow the visitor’s system setting.
Core blocks or a widget?
You can build testimonials with core blocks only: a Quote block per testimonial, saved as a synced pattern so you can reuse it. It compares like this:
| Quote blocks and a synced pattern | Vouchjar widget | |
|---|---|---|
| Styling | Matches your theme exactly | Neutral cards, light or dark |
| Getting testimonials in | You copy each one in yourself | Customers submit through a link, or you paste from X/LinkedIn |
| Approval step | Your normal draft and publish | Built in: nothing shows until you approve it |
| Adding a new one | Edit the pattern, then save | Approve in the dashboard, live within a minute |
| Cost | Free | Free for 5 testimonials, then $8/month |
For three quotes that never change, core blocks are fine and fit your theme best. Once you’re chasing customers for testimonials and pasting them in by hand, the link and the widget save you that work.
The same two lines work in a Ghost HTML card too. See the Ghost testimonials guide.
FAQ
- Why did WordPress remove the script from my Custom HTML block?
- Your account doesn't have the unfiltered_html capability. On a normal site only Administrators and Editors have it, on multisite only Super Admins do, and a site with DISALLOW_UNFILTERED_HTML set in wp-config.php blocks it for everyone. Ask an administrator to paste the code, or load the script from functions.php so other roles only need to add the div.
- What does "This block contains unexpected or invalid content" mean?
- The block's saved markup no longer matches what you typed, which often happens when WordPress filtered out the script tag on save. Don't click to recover it, because the converted block won't load anything. Have someone with unfiltered HTML permission paste the code again.
- Do I need to clear my cache after approving a testimonial?
- No. Caching plugins store your page's HTML, but the widget fetches testimonials in the visitor's browser. A newly approved testimonial shows up within about a minute, cached page or not.
- Can I show the testimonials in my sidebar or footer?
- Yes. On a classic theme, go to Appearance, then Widgets, and add a Custom HTML block to a widget area. On a block theme, open Appearance, then Editor, edit the footer template part and add a Custom HTML block there.
- Does it work on WordPress.com?
- Only on a plan that allows plugins (Business and up), with hosting features turned on. On other WordPress.com plans the script tag isn't allowed, so the wall won't load. Self-hosted WordPress has no plan limit.
Free for 5 testimonials. No card. Pro is $8/month.
Short version: WordPress install steps in the docs.
Updated October 16, 2026