Docs
← Back to site

Reusable Content Snippets

3 min readUpdated November 6, 2026

Snippets let you write a piece of content once and reuse it across many docs, a warning, a disclaimer, a repeated setup step, and have it update everywhere at once when you edit the original.

Creating a snippet#

  1. Go to WP Super Docs → Snippets.
  2. Click Add New.
  3. Give it a title and write its content in the block editor, using the same blocks you’d use in any doc.
  4. Publish it.
Editing a snippet: its title and content in the block editor.

A snippet’s title is for your own reference in the admin list and picker, it isn’t shown to readers unless you choose to include it in the snippet’s own content.

Embedding a snippet in a doc#

There are two ways to embed a published snippet:

The Doc Snippet block. Add a Doc Snippet block from the inserter, then choose the snippet from the picker. The editor shows a preview card with the snippet’s title and a short excerpt, along with an Edit snippet link that opens it in a new tab.

A Doc Snippet block inside a doc in the editor.

The shortcode. You can also embed a snippet directly by its slug:

Both methods render the same thing on the frontend. The block is easier to work with since it shows you a picker and a live preview, the shortcode is useful if you’re pasting content from elsewhere or prefer working directly in the code editor.

Template variables#

A snippet’s content can include placeholders written as {{variable}}. When embedding with the shortcode, any extra attribute you add is filled in:

If the snippet’s content contains {{limit}}, it’s replaced with 1000 wherever it appears. Names match in any letter case and with or without spaces inside the braces, so {{limit}}, {{ limit }} and {{Limit}} all work. Use letters, numbers, hyphens and underscores in names.

A placeholder without a matching attribute is left as it is, so a missing value is easy to spot on the page.

This only works with the shortcode; the Doc Snippet block doesn’t have a way to set variables.

Fixed in 1.0.14

Variables weren’t filled in before this version. If you added variables earlier and saw the raw {{name}} text on the page, it now shows the value.

Seeing where a snippet is used#

The Snippets screen listing snippets with their shortcode and where they are used.

The Snippets admin list shows a Shortcode / Slug column with the exact shortcode to copy, and a Used In column showing how many docs currently embed that snippet, hover over the count to see their titles.

This list updates whenever a doc that embeds the snippet is saved, so it reflects embeds added or removed since the last save, not necessarily the current unsaved state of the editor.

Snippets inside snippets#

A snippet’s content can itself embed another snippet. This is allowed, but only two levels deep, if a snippet tries to embed itself (directly or through a chain) beyond that depth, the extra embed is skipped rather than causing an infinite loop.

Snippets and Claude#

If Claude is connected (see Connecting Claude to Your Docs (MCP)), it can:

  • List your snippets, with each one’s variables and how many docs use it, and use a snippet in a doc instead of repeating the same text. In Markdown, Claude writes the snippet’s shortcode on a line of its own, and WP Super Docs turns it into a Doc Snippet block, or a shortcode when it passes variables.
  • Create new snippets from Markdown, using {{name}} for the parts that change per doc. New snippets are drafts, so they don’t show in docs until someone publishes them, unless you’ve let Claude publish and ask it to.
  • Change a snippet. Because that changes every doc using it, Claude can only change a published snippet when your site lets Claude publish, or when changes to published docs go live right away. A published snippet keeps its slug, since docs find it by that.

Try: “Make a snippet with our PHP and WordPress requirements and use it in every installation doc.”

Was this helpful?

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only