Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

All docs

Testing mode Pro

Pro · This feature is part of Snipfire Pro. Plans

Testing mode lets you try a snippet on the live site without visitors seeing it. It runs only for testers:

  • administrators, and team members who can edit snippets (see Team access),
  • anyone who opened the preview link, such as a client who needs to approve a change.

Everyone else gets the site without it. When you're happy, click Go live.

Put a snippet in testing mode

  1. Open the snippet. At the top of the settings panel, set Who sees it to Only testers (testing mode).
  2. Switch it on (Active) and save.

The toolbar shows Testing next to the Active switch, the sidebar marks the snippet with a TEST pill, and the Testing filter lists every snippet in testing.

Now open the site in the same browser: you see the snippet running. Open it in a private window: you don't.

Click Copy preview link in the snippet's settings (or Copy preview link for others… in the admin bar) and send it to whoever should see the test. The link looks like https://example.com/?snipfire-preview=….

  • It works for people who aren't logged in.
  • It stays on in their browser until they close it, or click Exit preview on the small badge in the bottom corner (Preview: 2 test snippets are on).
  • It shows all snippets in testing mode, not only one.

To stop old links from working, make a new one: wp snipfire preview new-key (or through the REST API). Everyone with the old link loses access.

While you're testing

  • The WordPress admin bar shows N snippets in testing, listing each one and marking those that ran on this page.
  • Pages viewed with the preview link are never cached: Snipfire sends no-cache headers and tells caching plugins to skip them (DONOTCACHEPAGE), so a page cache can't show test output to visitors.
  • Conditions still apply: a tester only sees the snippet where its conditions match.

Go live

Click Go live (Show it to everyone (saves)) in the editor. Who sees it changes to Everyone and the snippet is saved: from now on every visitor gets it. You'll see "…" is live.

Good to know

  • PHP on Run immediately. WordPress doesn't know who's logged in that early, so for logged-in testers a test snippet on Run immediately runs a moment later, at the very start of plugins_loaded. For preview-link visitors it runs at the usual time.
  • Without Pro, a snippet in testing mode runs for nobody. It isn't shown to visitors by accident.
  • Snippets in testing mode are listed in the activity log like any change.

From the command line

wp snipfire create --title="New banner" --type=html --mode=test --active --file=banner.html
wp snipfire update 12 --mode=live      # go live
wp snipfire preview                    # show the preview link
wp snipfire preview new-key            # make a new link (old ones stop working)

Something unclear or missing? Tell us