Skip to main content

HTML & frameworks · 5 min read

How to embed Google reviews in HTML

If you control the markup, this is the shortest path there is: one script tag in the body, at the point the reviews should appear. It works the same on a hand-written HTML page, a Hugo template, an Astro layout or a React component.

Last reviewed by the Reviews Widget product team.

What the snippet actually does

The tag loads a small async script carrying your grid ID. It creates a shadow root at that point in the DOM, renders your reviews inside it, and injects matching JSON-LD. Shadow isolation is why your site's CSS cannot leak in and the widget's CSS cannot leak out.

Google reviews HTML, no plugin required

Getting the embed code for your Google reviews takes one click: open the Embed tab on your grid and copy the script tag. That tag is the whole integration. Because it is ordinary HTML, you can embed Google reviews on a website with no plugin, no CMS extension and no package to install — the same line works in a hand-written page, a Webflow custom code block, a Shopify theme file or a React component.

If you've been searching for a way to embed Google reviews on a website without a plugin, this is it — there's no WordPress plugin to update, no app subscription inside your CMS and nothing that breaks when the platform upgrades. The widget lives on our infrastructure; your page only ever holds the tag.

The Google review embed code carries only your grid ID, so nothing sensitive sits in your markup, and changing layout or colours later updates every page using that grid without you editing a single file. If you would rather follow a platform-specific walkthrough, start from the how-to guides.

Step-by-step for a plain HTML page

Skip the reading — build your widget now

Free plan, no credit card. Your reviews are embedded before you finish this guide.

  1. 1

    Create your free Reviews Widget

    Sign up, search your business name to attach your Google Business Profile, and let the first fetch pull in your reviews and aggregate rating.

  2. 2

    Style the widget

    Choose a layout and set colours, corner radius and font scale to match your site, using the live preview at desktop, tablet and mobile widths.

  3. 3

    Copy the embed snippet

    Open the Embed tab and copy the one-line script tag, which carries your grid ID as a data attribute.

  4. 4

    Open your HTML file

    Open the page in your editor and find the exact place in the body where the reviews should appear.

  5. 5

    Paste the script tag

    Paste the tag at that point in the markup. The widget renders in place, so its position in the body is its position on the page.

  6. 6

    Deploy and verify

    Upload or deploy the file, open the live URL, and confirm the reviews render.

  7. 7

    Check the structured data

    Run the live URL through Google's Rich Results Test to confirm the injected JSON-LD parses without errors.

React, Next.js, Astro and static generators

Where to put the snippet in common stacks
StackWhere it goesNote
Plain HTMLDirectly in the bodyRenders exactly where the tag sits
React (Vite, CRA)Append the script to a ref'd div in useEffectSurvives hydration and re-renders
Next.jsnext/script, or a client componentAvoid rendering the tag during SSR output only
AstroDirectly in the .astro templateAstro emits it as static HTML
Hugo / JekyllIn a layout, partial or includeShared partial gives sitewide placement
Vue / NuxtonMounted, appending the script elementSame pattern as React's useEffect

In any framework that hydrates, append the script element from a mount effect rather than rendering it as JSX. A script tag written as JSX is inert — React will not execute it — which is the most common reason a framework embed silently does nothing.

Performance and CSP notes

Performance and security considerations
ConcernBehaviourWhat to do
Render blockingThe script loads asynchronouslyNothing required
Layout shiftThe widget has no height until reviews loadSet a min-height on the wrapper
Style collisionsShadow root isolates all stylesRestyle in the dashboard, not with site CSS
Strict CSPBlocked scripts fail silentlyAllow the widget origin in script-src and connect-src
Below-the-fold placementStill loads on page loadFine — the payload is small

Troubleshooting

Common HTML embed problems and their fixes
SymptomLikely causeFix
Nothing renders, no console errorScript tag rendered as JSX in a frameworkAppend the script element in a mount effect
Console shows a CSP violationStrict Content Security PolicyAllow the widget origin in script-src
Reviews appear at the wrong placeTag placed in the headMove the tag into the body where it belongs
Content jumps as reviews loadNo reserved heightAdd a min-height to the wrapping element
Widget missing in a browser but not othersAd blocker or tracking protectionTest in a clean browser profile
Duplicated widgetScript appended twice by a re-renderGuard the effect so it runs once

Sources & further reading

Frequently asked questions

How do I embed Google reviews in plain HTML?+

Paste a single script tag into the body of your HTML file at the point where the reviews should appear, then deploy. The script loads asynchronously, renders the widget in place, and injects matching JSON-LD structured data. No build step, dependency or backend is involved.

Does the snippet work in React or Next.js?+

Yes. In React, render the script tag from a small component using a useEffect that appends the script element to a ref'd container, so it survives hydration. In Next.js, dangerouslySetInnerHTML in a client component or the next/script component with the same src both work.

Will it work on a static site generator like Hugo, Jekyll or Astro?+

Yes. These generators output plain HTML, so the tag can go directly into a layout, partial or template. Placing it in a shared partial gives you the widget on every page that includes that partial, which is the simplest route for a footer badge.

Does the script slow my page down?+

It should not. The script is small and loads asynchronously, so it never blocks parsing or rendering. Reserve a min-height on the wrapping element to prevent layout shift while the reviews fetch, which protects your Cumulative Layout Shift score.

Do I need to change my Content Security Policy?+

Only if you run a strict CSP. Allow the widget's origin in your script-src directive, and in connect-src if your policy restricts fetches. If reviews fail silently with a CSP violation in the browser console, that directive is the cause.

Can I put the tag in the head instead of the body?+

You can, but the widget renders where the tag sits, so a head placement gives you no control over position. Keep the tag in the body at the exact point you want the reviews, which is also the simplest thing to reason about later.

How do I get the embed code for my Google reviews?+

Open your grid, go to the Embed tab and copy the one-line script tag shown there. That is the complete Google reviews embed code — it carries your grid ID and nothing else, so it is safe to paste into any public page.

Can I embed Google reviews on a website without a plugin?+

Yes. The snippet is plain HTML, so it runs anywhere HTML runs: static sites, hand-coded pages, custom code blocks in site builders and framework components alike. A plugin only ever wraps the same idea in an extra install.

Ready to embed Google reviews on your site?

One script tag. Any stack, any host.

All how-to guides