How to embed an interactive chess replay on a website
An embedded replay is a playable chess replay inside your own page: a blog post, a club results page, a coaching site. It is one iframe you copy from the replay’s share dialog.
A link sends readers away from your page. An embed keeps the replay where the writing is: the reader steps through the moves right next to your explanation, and nothing on your site needs to change beyond pasting one element.
Get the embed code
Open the shared replay
Build the replay in the editor and click Create public link, then open that link — the public page that starts with chessmotion.com/p/.
Choose Embed
Click Embed. The dialog shows a live preview of exactly what your readers will see.
Pick a size
Responsive follows the replay’s own format — landscape replays get a 16:9 frame, others a square one. You can also fix it to 16:9, 1:1 or 9:16.
Copy and paste
Copy the code and paste it into your page wherever HTML is allowed.
What does the embed code look like?
It is a single iframe — no script to load, and no wrapper element for an editor to strip out:
<iframe src="https://chessmotion.com/embed/your-replay" style="width:100%;aspect-ratio:1 / 1;border:0" loading="lazy" allowfullscreen title="The smothered mate on ChessMotion"> </iframe>
It takes the full width of its container and keeps its shape with aspect-ratio, so it resizes with your layout on a phone. loading="lazy" means a replay further down the page does not slow the top of it.
Pasting it into your site
- A blog or CMS editor — use the block or mode that accepts raw HTML, often called “Custom HTML”, “Embed” or “Code”.
- A hand-written page — paste the iframe where the replay should appear.
- A site builder — look for an embed or HTML element and paste the code into it.
If your editor removes iframes, it is set to strip them for everyone; the fix is a setting in that editor, not in the code.
How do you change how it behaves?
Add options to the end of the src address:
- ?autoplay=1 — start playing without a click. Off by default.
- ?controls=0 — hide the playback controls. On by default; leave them on if readers should step through the moves.
- ?loop=1 — play again from the start when it finishes.
Combine them with &, for example ?autoplay=1&loop=1.
Try it yourself. No account required.
Which size should you choose?
- 1:1 for a single position, a puzzle or a mate. On a 700-pixel article column the embed is 700 pixels tall, which shows the board without scrolling on most screens.
- 16:9 for a full game, with room beside the board for the players and the move list.
- 9:16 only on pages read mostly on phones, such as a link-in-bio page. On a desktop column it becomes very tall.
What if the embed does not show?
- An empty frame on your own site: some sites set a security policy that blocks iframes from other domains. Allow https://chessmotion.com in the site’s frame-src setting, or ask whoever runs the site.
- An old version of the replay: the embed shows the shared snapshot. Click Update shared replay with current edits in the editor.
- The replay is unavailable: a replay switched to private is not shown to readers, in the embed as well. Switch it back to unlisted or public.
Several replays on one page
Each embed loads only when a reader scrolls near it, so a page with several replays still opens quickly. For reading, three or four per article is a sensible limit. A tournament report with ten games works better with the decisive game embedded and the other nine as links, each opening its own replay.
Make the page readable without the embed
Readers on slow connections, and search engines, see your text before the replay loads. Write the key moves in the text next to the embed, and keep the title attribute in the code, which screen readers announce. A sentence such as “White mates in five, starting with 1.Qd5+” helps every reader, whether or not the replay plays.
Good to know
- Readers need no account to play an embedded replay.
- No ads appear inside the embed, so it does not put advertising into your article.
- The frame carries a small ChessMotion credit, which the options above do not remove.
- It shows the replay as it was when you created the link. Editing the project does not change it until you click Update shared replay with current edits in the editor — then the link and every embed of it show the new version, at the same address.
An embed works best next to writing that explains the position. For a lesson built this way, see the smothered mate in the Chess Library.
Read next: Share a chess replay online, Run a Game of the Week for your club, Review a student’s game with variations and ChessMotion for chess clubs.