Snippets you can script.
Everything the editor does, you can do from WP-CLI or the REST API. Snippets are plain files, so they back up, diff and deploy like the rest of your code.
wp snipfire
The WP-CLI commands are in the free plugin. Pro adds team access, the activity log, consent and preview commands; Git needs the Agency plan.
# Create a snippet from a file and switch it on
$ wp snipfire create --title="Hide admin bar" \
--file=hide-admin-bar.php --folder="Site tweaks" --active
# Try it on the live site for admins only first (Pro)
$ wp snipfire update 42 --mode=test
# Everything that's switched on, as JSON
$ wp snipfire list --status=active --format=json
# Bring back yesterday's version
$ wp snipfire revisions 42
$ wp snipfire restore 42 <rev>
| Command | What it does |
|---|---|
list |
List snippets, filtered by type or status |
get <id> |
Show one snippet, or just its code |
create / update |
Create or change a snippet: code from a file or stdin, hook, priority, conditions, folder, tags |
enable / disable |
Switch snippets on (validated and test-loaded) or off |
run <id> |
Run a PHP or HTML snippet once and print its output |
revisions / restore |
List a snippet's versions and bring one back |
export / import |
JSON export and import; imports arrive switched off |
import-from |
Import from another snippet plugin, with --dry-run and --switch |
shortcodes |
Find where snippet shortcodes are used, and rewrite old plugins' ones |
files |
ads.txt, app-ads.txt, llms.txt, security.txt and robots.txt lines |
safe-mode / info |
Safe mode links, and where snippets are stored |
access |
Team access per role Pro |
log |
The activity log, filtered by snippet, user or action Pro |
consent / preview |
Cookie consent status, and testing-mode preview links Pro |
git |
setup, check, sync, status, resolve, reset Agency plan |
REST API
Under /wp-json/snipfire/v1/, signed in with WordPress cookies and a nonce, or an application password.
Each route checks the user's access level: reading needs "view", changing snippets needs "design" (and each change is checked against that level), and imports, settings and Git need "full".
| Route | What it's for |
|---|---|
GET /snippets, POST /snippets |
List and create |
GET, PUT, DELETE /snippets/{id} |
Read, update and delete one snippet |
POST /snippets/{id}/enable, disable, run, duplicate |
Switch on (with a test load), off, run once, duplicate |
GET /snippets/{id}/revisions, POST …/restore |
History and restore |
POST /bulk, /folders/rename, /validate |
Bulk actions, folders, validation without saving |
GET /export, POST /import |
JSON export and import |
GET /import/sources, POST …/run, …/switch |
Importers and switch over |
GET /activity |
The activity log Pro |
GET /git, POST /git/sync, /git/webhook |
Git sync status, sync now, signed webhook Agency plan |
Files and constants
No custom tables to migrate, and nothing hidden in serialized options.
wp-content/snipfire/ | Snippets as guarded PHP files, plus one compiled index |
|---|---|
wp-content/uploads/snipfire/ | Compiled CSS and JavaScript files |
SNIPFIRE_SAFE_MODE | Stop every snippet from running, site-wide |
SNIPFIRE_DISABLE_PHP | No PHP snippets for anyone, administrators included. CSS, JavaScript and HTML keep working |
SNIPFIRE_DELETE_DATA | Delete snippet files on uninstall (they're kept otherwise) |
SNIPFIRE_GIT_TOKEN | Keep the Git access token in wp-config.php instead of the database Agency plan |
Filters let you change the capability needed to manage snippets and add your own import sources.
AI assistants, through WordPress abilities.
Turn on Tools → AI assistants and Snipfire registers WordPress abilities. Connect Claude, Cursor or any MCP client through the WordPress MCP adapter with an application password.
Abilities have exactly the access of the user who connected them. New snippets start switched off, and switching one on test-loads the site like any save.
| Ability | What it's for |
|---|---|
snipfire/list-snippets |
List snippets, with filters |
snipfire/get-snippet |
Read one snippet: code and settings |
snipfire/list-locations |
The places a snippet can run |
snipfire/validate-snippet |
Check code without saving it |
snipfire/save-snippet |
Create or update a snippet |
snipfire/set-snippet-status |
Switch a snippet on (with a test load) or off |
snipfire/list-activity |
Read the activity log Pro |
Your snippets in Git.
Two-way sync with GitHub or GitLab, cloud or self-hosted, through their APIs: nothing to install on the server. Edit in VS Code, open a pull request, push, and the site follows.
$ wp snipfire git setup --provider=github \
--repo=acme/snippets --token=github_pat_… --check
$ wp snipfire git sync
$ wp snipfire git status
$ wp snipfire git resolve all --keep=git
Move your snippets over this afternoon.
Importing changes nothing until you switch over, and your old shortcodes keep working.