SwissTrustWidget
WordPress guide

Embed Google Reviews in WordPress – In 3 Steps

Create the widget, copy the code, paste it into a Custom HTML block. No plugin, no API key, no coding skills.

In short

You create the widget in your SwissTrustWidget account and copy the embed code. In WordPress, you add a Custom HTML block to the page you want, paste the code in and save. From then on, the reviews load by themselves. What you need: a Google Business Profile with reviews and a WordPress user with the Administrator or Editor role.

In Switzerland, WordPress is by far the most widely used website system: of all .ch websites whose CMS can be identified, 51.1% run on WordPress — far ahead of Wix (9.1%) and Shopify (4.0%), according to W3Techs (September 2026). To show Google reviews on a WordPress site, most guides recommend a plugin. There is a simpler way: SwissTrustWidget gives you a two-line HTML snippet that you paste into an ordinary block. No extra plugin to keep updated, no Google API key, no changes to your theme.

Embedded in 3 steps

1

Create the widget in SwissTrustWidget

Open a free account and connect your business via the search — company name and town are enough, no Google login required. Then choose one of the 15+ templates: badge, carousel or review cards. Light or dark mode, size, alignment and the number of reviews shown are all set in the preview.

2

Copy the embed code

One click on the copy button puts the code on your clipboard. It consists of two lines: a placeholder with your settings and the script that loads the reviews. Your Place ID is already filled in — there is nothing to change.

3

Paste it into WordPress and save

Open the page in the block editor, add a Custom HTML block via the plus icon and paste the code into it. Once you save (Update in older WordPress versions), the widget is live. For Elementor, Divi and other page builders, the table below shows the right element.

What the embed code looks like

HTML
<div class="google-review-widget"
  data-template="medium-badge"
  data-theme="light"
  data-lang="en"
  data-place-id="YOUR_GOOGLE_PLACE_ID"
  data-max-reviews="3"
  data-show-name="true"></div>
<script src="https://app.swisstrustwidget.ch/widget.js" async></script>

Multilingual site? One separate code per language version. The language goes in data-lang, right after data-theme — fr, it or en; German needs no attribute. It sets the widget labels and which reviews Google returns first; the review texts stay in their original language.

Example with a placeholder — copy your own code, with your Place ID, from your account. The first line marks the spot where the widget appears. The second loads the script: under 10 KB and asynchronous, so it does not hold up the page.

Where the code goes in your editor

Depending on the editor or page builder, the element for custom code has a different name. The code itself stays the same everywhere.

Block editor (Gutenberg)Add a Custom HTML block and paste the code into it.
Classic EditorSwitch to the Text tab and paste the code there. In the Visual tab it would otherwise show up as text on the page.
Widget areasWith a classic theme, go to Appearance → Widgets and add a Custom HTML block to the footer or sidebar. The widget then appears on every page.
Block themesWith themes such as Twenty Twenty-Five, edit the footer under Appearance → Editor and insert a Custom HTML block there — also site-wide.
ElementorDrag the HTML widget onto the page. For a header or footer on every page, use the Elementor Pro Theme Builder.
DiviInsert the Code module. Site-wide via the Divi Theme Builder in the global footer.
WPBakeryInsert the Raw HTML element.
Beaver BuilderInsert the HTML module.
AvadaInsert the Code Block element.

If you write the code straight into theme files, use a child theme — otherwise the next theme update will overwrite the change. Working with Elementor? See the detailed Elementor guide

Plugin or embed code?

Both put Google reviews on your site. The difference lies in the work that remains after setup.

SetupWordPress pluginFind the plugin, install it, activate it and connect it to GoogleEmbed code (SwissTrustWidget)Copy the code and paste it into a block
Google connectionWordPress pluginDepending on the plugin, your own Google API key with a Google Cloud billing account, or an account with the plugin vendorEmbed code (SwissTrustWidget)No API key: search for and connect your business in your account
MaintenanceWordPress pluginPlugin updates; conflicts possible after WordPress or theme updatesEmbed code (SwissTrustWidget)None — the code runs outside your WordPress installation
DisplayWordPress pluginHTML and CSS inside the theme: theme styles can shift the layoutEmbed code (SwissTrustWidget)Its own frame (iframe): theme and widget do not affect each other
Changing CMSWordPress pluginOnly works in WordPressEmbed code (SwissTrustWidget)The same code runs on Wix, Shopify, Webflow and any HTML page
CostWordPress pluginFree versions with limits, pro versions mostly as an annual licenceEmbed code (SwissTrustWidget)Free with branding, without branding CHF 49 one-time

One example: the widely used plugin Widgets for Google Reviews by Trustindex has more than one million active installations according to WordPress.org. The free version carries Trustindex branding; paid plans start at $65 per year and are billed annually only (as of 11 September 2026). Trustindex vs SwissTrustWidget compared

Widget not showing? The six most common causes

The code disappeared after saving

WordPress strips script code when your user account is not allowed to save unfiltered HTML (the unfiltered_html capability). Only Administrators and Editors have it — on a Multisite network, only Super Admins. Have someone with that capability paste the code.

The code shows up as text instead of stars

The code is sitting in a Paragraph block or in the Visual tab of the Classic Editor. Delete it there and paste it into a Custom HTML block — in the Classic Editor, into the Text tab.

The widget only appears after scrolling or a click

A performance plugin is holding back JavaScript until the first interaction. In WP Rocket the option is called Delay JavaScript execution; LiteSpeed Cache and Perfmatters have similar settings. Add "swisstrustwidget" to that option's exclusion list.

A design change does not show up on the site

Template, mode and size are part of the code itself. After a change in your account, copy the new code and replace the old one in the block. If the page still shows the old version, clear the cache of your caching plugin — and, if applicable, your host's or Cloudflare's — then check in a private browser window.

The browser console says "Refused to load" or "Refused to frame"

A Content Security Policy is blocking the widget, set by a security plugin or your host. Allow https://app.swisstrustwidget.ch as a source for scripts (script-src) and frames (frame-src).

The widget is not where it should be

In your SwissTrustWidget account, set the alignment to left, centre or right and copy the code again. The widget then aligns itself, regardless of theme and block settings.

Frequently asked questions about WordPress

Sources

Ready? Create your WordPress widget in 60 seconds.

Try it free — no plugin, no subscription. Without branding: CHF 49 one-time.