Troubleshooting
My site is down or I can't log in
- Open your safe mode link (from Tools & Safe Mode; you saved it, right?). All snippets stop in your browser, so you can log in and fix things.
- No link? Add
define( 'SNIPFIRE_SAFE_MODE', true );towp-config.phpwith your host's file manager or SFTP. Snippets stop for everyone. Remove the line when you're done. - In Snipfire → Snippets, use the Errors filter, or find the snippet you changed last. Fix it or switch it off.
Snipfire usually switches a crashing snippet off by itself; if the site is still down, the problem may not be a snippet at all. With snippets stopped by safe mode, if the site still fails, look at other plugins or the theme.
More in Safe mode.
A snippet was switched off by itself
Snipfire switches a snippet off when it causes an error, so your site keeps working. You'll see a notice with a Fix it link, and the snippet shows Switched off after an error on line ….
Fix the error, turn Active on and save. Common causes:
- Call to undefined function: the code uses a function from a plugin that isn't active, or that isn't loaded yet at the snippet's location. Check
function_exists(), or move the code into a hook that runs later (init,wp). - Cannot redeclare: a function with that name already exists. Rename it, wrap it in
if ( ! function_exists( … ) ), or use a closure. - Errors only on some pages: for example code that assumes
$postexists. Add a check, or a condition.
A snippet doesn't run
Go through these in order:
- Is it on? The Active switch, saved. The sidebar filters On / Off help.
- Did it save with problems? Saved, but left switched off until the problems are fixed. means it's off. Look at the Problems panel.
- Is it in testing mode? (Pro) Then only testers see it: check Who sees it.
- Does it wait for cookie consent? (Pro) It runs only after the visitor accepts, and not at all without a consent tool unless you chose run for everyone. The sidebar shows Consent on such snippets.
- Do the conditions match? Remove them temporarily to check. Remember rules can't be checked too early: a page rule on Run immediately is refused on save; on a custom hook it just doesn't match. See Conditions and timing.
- Is the location right? An HTML snippet on After <body> opens needs a theme that supports it. Before/After post content and the paragraph locations only apply to post content shown by the page's main loop, not to excerpts, widgets or page builder sections that don't use the post content. The excerpt and post list locations only apply on blog, archive and search pages. See Where snippets run. A PHP snippet on a custom hook only runs if something fires that action.
- Is it a shortcode snippet? As a shortcode snippets only run where the shortcode is placed.
- Is a page cache serving an old page? Clear the cache. For snippets that depend on the visitor (logged in, cookies, cart, country), see Conditions and page caching.
- Are you in safe mode? The editor shows Safe mode is on: no snippets run in your browser. Turn it off on the Tools page.
- Is
SNIPFIRE_SAFE_MODEinwp-config.php? Then no snippet runs for anyone. - Is it PHP, with
SNIPFIRE_DISABLE_PHPinwp-config.php? Then no PHP runs from Snipfire, including PHP inside HTML snippets. See Locking Snipfire down.
Use Run to check a PHP or HTML snippet's output directly: it ignores conditions.
CSS doesn't apply
- Check that the selector matches: open your browser's developer tools and inspect the element.
- Another stylesheet may win. Make the selector more specific, or raise the snippet's Priority so it loads later.
- Where: Front end doesn't load in the block editor; choose Front end and block editor for that.
- With External file, a CDN or optimisation plugin may still serve the old file. Clear its cache.
Saving fails
- Not writable: snippets can't be saved on the Tools page: the web server can't write to
wp-content/snipfire/. Ask your host to fix the folder permissions. - Your session expired. Reload the page to continue. Reload the editor (your unsaved code is lost on reload, so copy it first).
- Request failed or an unexpected response: a security plugin or firewall (ModSecurity, Wordfence, Cloudflare WAF) may be blocking requests that contain code. Allow
/wp-json/snipfire/for logged-in administrators, or ask your host.
Everything is read-only, or Tools & Safe Mode is missing
- The editor says Snipfire is read-only on this site because DISALLOW_UNFILTERED_HTML is set in wp-config.php. That WordPress setting makes Snipfire view only for everyone, administrators included, and hides Tools & Safe Mode and Header & Footer. Remove the line from
wp-config.phpto make changes, or use WP-CLI. See Locking Snipfire down. - The editor says You can view snippets but not change them. Your role has View only in team access. Ask an administrator.
The editor doesn't load
- A browser extension (ad blockers, script blockers) may be blocking it. Try a private window.
- Use the Classic view (link at the top of Tools & Safe Mode) meanwhile: it works without JavaScript.
- Check the browser console for errors and include them when you contact support.
The test load fails but the site works
When you switch on a PHP or HTML snippet, Snipfire loads a page of your site in the background. If the site can't request itself (some hosts, firewalls, basic-auth protection on staging sites, local development setups), the test load may fail or time out. The message will say so. Check with your host that the site can make requests to its own address.
SCSS and LESS
- SCSS and LESS need the PHP "mbstring" extension…: ask your host to enable
mbstring. - A partial isn't found: import it by its exact title or its ID. Check the Use as a partial box on the partial for the right line.
- See SCSS and LESS for what happens on errors.
Git sync
Still stuck?
We're happy to help.
- Using the free plugin? Use the contact form on snipfirewp.com.
- Have Snipfire Pro or Agency? Use the contact form, or email support@snipfirewp.com.
Tell us what you expected, what happened, the snippet's code and settings (⋯ → Export as JSON), and your WordPress, PHP and Snipfire versions (Tools → Site Health → Info has them all). In the public forum, leave out anything private, such as API keys in your code.
Something unclear or missing? Tell us