Skip to main content

Puzzle embed automation

Objective

Learn how to automate the process of publishing individual puzzles, using parameters that can predictably identify a puzzle.

When you are managing a lot of puzzles, you will need ways to address and load your puzzles in predictable ways. You can set up embed codes for a specific puzzle using predictable slugs, which can be assigned at the time of puzzle creation or import. Read on to find out more about this approach.

Predictable slugs for date based puzzles

In this method, the puzzle slug is explicitly set by you. This slug can be set at the time of puzzle creation or import and cannot be changed once it has been set.

There are two ways to set the slug. The first is to enter it manually in the slug field while creating the puzzle. The second way is a shortcut provided by the PuzzleMe™ platform upon import of files named in a certain format. Such files automatically lead to a slug and publish time being set according to the filename when the puzzle is imported. The filename should be made up of two parts - a prefix and the publish date for the puzzle, which is represented in YYYYMMDD format, separated by the "" (underscore) character. For example, an imported puzzle file intended to be published on 29th July, 2025 could be named _sample-crossword_20250729.xml. PuzzleMe will automatically set the puzzle's publish time to midnight (00:00) of 29th July, 2025, and set the slug to sample-crossword_20250729 . This slug can then be used to refer to and embed this puzzle. Note that the part of the filename before the underscores can only have the letters A-Z (or a-z), digits and hyphens. Spaces and other special characters are not allowed.

This method will lead to a puzzle URL that looks like this:

https://cdnx.amuselabs.com/pmm/crossword?set=sample-crossword&id=slug-that-you-set
https://cdnx.amuselabs.com/pmm/crossword?set=sample-crossword&id=sample-crossword_20250729

This approach can also be used to predictably generate the PuzzleMe WordPress plugin shortcode. In the sample shortcode below, the value of the id is generated based on the formula described above.

[puzzleme basepath='https://puzzleme.amuselabs.com/pmm/' set='sample-crossword' id='sample-crossword_20220709' type='crossword']
Tip

This approach works best when puzzles are published with a regular cadence and you need control over the puzzle's slug in order to get predictable embed codes or shortcodes.

Looking for automatic updates?

If you want your embed to automatically show the latest puzzle in a series without needing to update embed codes, check out the Publishing series "Latest puzzle" option for a more automated approach.