Developer docs

Embed widget reference

Everything you need to embed a PixelGamesHub game on your site. If you're new here, read the partner overview first.

Snippet anatomy

A standard embed snippet has two parts: the iframe (the game player) and the attribution paragraph (the SEO-counting dofollow anchor back to PixelGamesHub).

<iframe src="https://pixelgameshub.com/games/<slug>/embed"
        width="800" height="600"
        frameborder="0" allowfullscreen
        sandbox="allow-scripts"
        loading="lazy"
        title="<Game Title> — Free browser game"></iframe>
<p>Play <a href="https://pixelgameshub.com/games/<slug>"><Game Title></a>
   free on <a href="https://pixelgameshub.com">PixelGamesHub</a>.</p>
  • src — points to /games/<slug>/embed, our minimal iframe-ready shell.
  • sandbox — defaults to allow-scripts. Provider-specific overrides documented below.
  • loading="lazy" — the iframe defers loading until close to the viewport. Strongly recommended.
  • allowfullscreen — required for fullscreen mode; harmless if the game doesn't use it.
  • attribution <a> — must remain dofollow. This is the link search engines credit.

Sandbox tokens

Our snippet ships with the minimum set of tokens for each specific game. You can tighten further, but loosening (adding tokens) is occasionally needed for storage-using providers.

TokenWhat it allowsWhen to includeDefault
allow-scriptsLets the embedded game run JavaScript. Required for nearly every interactive game.AlwaysYes
allow-same-originLets the iframe content treat itself as same-origin — needed for cookies, localStorage, IndexedDB.Only when the game needs persistent storage (save progress) or a consent flow (e.g. GamePix games)No
allow-popupsLets the game open new windows (game guides, social shares).Rarely needed; some providers like GamePix require it for their TCF consent flowNo
allow-formsLets the game submit HTML forms.Required by a small number of consent-flow providers; not by gameplay itselfNo
allow-pointer-lockLets the game capture the mouse pointer (FPS-style controls).Only when the game uses pointer-lock (rare for casual browser games)No

Attribution policy

  • Keep the <a> link in the attribution paragraph below the iframe. You may change the visible text, but not the href.
  • The in-iframe 'Powered by PixelGamesHub' footer is rendered by us and is not modifiable.
  • If you embed multiple games, one attribution paragraph per iframe is the minimum. A combined credits section at the end of the article is also fine.
  • On a heavily-styled site, you may use any class names or CSS resets that don't visually remove or hide the link.
  • image-only attribution (a logo without an <a>) does NOT count — search engines need the href.

Privacy & security

What this widget will NEVER do

  • Read or write data in the parent page's DOM. The iframe is sandboxed.
  • Set third-party cookies on your domain. Cookies belong to pixelgameshub.com only.
  • Send the parent page URL or visitor IPs to ad networks. The embed shell isn't an ad placement.
  • Inject scripts into your page. The snippet is a single <iframe> + an <a>.

Content Security Policy

Embed shells respond with Content-Security-Policy: frame-ancestors * so any origin can iframe us. If your site has a strict CSP, you may need to allow https://pixelgameshub.com in your frame-src directive.

Sizing & responsiveness

The default 800×600 fits most desktop blogs. For responsive embeds, wrap the iframe in an aspect-ratio container:

<div style="position:relative; padding-bottom:75%; height:0; overflow:hidden">
  <iframe
    src="https://pixelgameshub.com/games/<slug>/embed"
    style="position:absolute; top:0; left:0; width:100%; height:100%; border:0"
    allowfullscreen
    sandbox="allow-scripts"
    loading="lazy"></iframe>
</div>

Recommended minimum is 480×360. Below that, some games clip the HUD on the right edge.

Platform integration

WordPress
Use the Custom HTML block, not the Image block. Both Classic and Gutenberg editors handle the snippet verbatim. The Code block escapes the snippet — do not use it.
Webflow
Drop an Embed element on the canvas and paste the snippet. Webflow's Designer will preview it live; the published site renders the real iframe.
Ghost
Use the HTML card (slash command: /html). Ghost passes the snippet through unchanged. If using Koenig (Ghost's editor), avoid the Markdown card.
Notion (public pages only)
Notion's native HTML embed strips iframes; use a workaround like /embed → enter our embed URL directly (https://pixelgameshub.com/games/<slug>/embed). Notion treats it as a generic embed, which works.
MDX (Next.js, Astro, etc.)
Paste the snippet verbatim inside your MDX. The <iframe> tag is JSX-compatible — no rewriting needed. If your CSP blocks iframes, allow https://pixelgameshub.com explicitly.
Plain HTML
Just paste the snippet. Tested against modern Safari, Chrome, Firefox, Edge. No polyfills required.

Full FAQ

Is there a partner key, API key, or signup required?
No. Copy the snippet, paste it into your HTML, and you're done. We don't gate the embed behind an account — the dofollow attribution link is the only thing we ask you to keep.
Can I resize the iframe?
Yes. Change the width and height attributes in the snippet. The game inside will scale responsively. Recommended minimum is 480×360; 800×600 is the sweet spot for desktop blogs.
Will the embed track my visitors?
The embed shell loads our analytics (GA4) when the visitor has granted consent on our domain. It does not set cross-site cookies on your domain. Your visitors' privacy stays under your control.
Can I remove the 'Powered by PixelGamesHub' footer?
The in-iframe footer is part of our page and can't be hidden — it's ~32px of branding. The external attribution paragraph below the iframe can be styled or rephrased, but the link must stay. Removing it violates our embed policy.
What if the game I embedded gets removed?
Already-pasted iframes will start showing our 404 page. We don't bulk-deprecate; check the game page if you're worried about a specific title.
Can I monetize a page that embeds your games?
Yes, including Google AdSense, Mediavine, and direct sponsorships. The only restriction: don't make the game itself subject to a paywall, and don't bundle it with adult or gambling content.
Does this work on WordPress / Webflow / Ghost / Notion?
Yes on all four. See the platform integration tips on /docs/embed for the easiest paste-paths per platform.
Can I embed multiple games on one page?
Yes. The iframes are independent. We recommend lazy-loading (the snippet includes loading='lazy') so an article with 10 games doesn't slow first paint.

Changelog

  • 2026-06-01

    Public launch of the embed widget. /embed marketing page, /docs/embed reference, 12,000+ embeddable games, CC-friendly attribution policy.