Switching from another snippet plugin
Snipfire imports snippets from other snippet plugins and then switches them over for you: off in the old plugin, on in Snipfire, with a test load of your site in between. Your visitors never see a gap or a page where a snippet ran twice.
Every importer is included in the free plugin.
| Moving from | What comes across | Switch over | Guide |
|---|---|---|---|
| WPCode (Lite and Pro) | All snippet types, locations (including paragraph, excerpt and post-list locations), priority, conditional logic, tags, notes, device, schedule and location rules, custom shortcodes, and the global Header & Footer boxes | One click | WPCode |
| Code Snippets (and Pro) | PHP (everywhere, admin, front end, run once), HTML (header, footer, shortcode), Pro CSS and JS | One click | Code Snippets |
| FluentSnippets | PHP, mixed content, CSS, JS, conditions, groups (as folders), load as file | One click | FluentSnippets |
| Header Footer Code Manager | HTML, CSS and JS, locations, page/post/category/tag/post type rules, device | One click | Header Footer Code Manager |
| Simple Custom CSS & JS | CSS, JS and HTML, header/footer, front end/admin/login, inline or file | One click | Simple Custom CSS & JS |
| Post Snippets | Shortcode snippets (PHP and HTML), with their variables and shortcode names | One click | Post Snippets |
| Woody Code Snippets | PHP, universal, HTML, text, CSS and JS snippets, insertion locations with paragraph and post numbers, display conditions, shortcodes | One click | Woody Code Snippets |
| Customizer "Additional CSS" | Your theme's Additional CSS | One click (a backup is kept) | Customizer Additional CSS |
| WPCodeBox | Snippets, for review (beta) | By hand, for now | WPCodeBox |
How it works
1. Import: nothing changes on your site
In the editor's sidebar, click Import (or the Found … snippets in … other plugins — Import them → hint). Snipfire lists the plugins it found snippets for under Plugins found.
Snipfire reads the other plugin's data directly, so the other plugin doesn't need to be active. Deactivated a plugin months ago and its snippets are still in the database? They show up too.
Pick a plugin to see its snippets: whether each one is on in that plugin, where it runs, its shortcode, how many conditions it has, and any notes. Tick the ones you want (or Select all) and click Import … selected.
The copies arrive:
- switched off, so both plugins never run the same code at once,
- in a folder called Imported/Plugin name,
- tagged
imported, - with notes in their description about anything that works slightly differently in Snipfire.
Importing changes nothing in the other plugin.
2. "Check first"
When Snipfire can't match something exactly (a location it doesn't have, a condition it can't convert), it marks the snippet Check first: Snipfire couldn't match everything exactly. Check it before switching it on. The note says what's different.
These snippets are never switched over automatically. They stay running in the old plugin until you've looked at them, fixed the location or conditions in Snipfire, and switched them on yourself. Snipfire never guesses silently.
3. Switch over
Back on the import screen, click Switch over. Snipfire asks Switch … snippets over from Plugin?, then:
- switches the snippets off in the other plugin,
- switches the imported copies on in Snipfire, and test-loads your site.
These happen in two separate requests, so no function is ever declared twice. If a copy crashes the test load, it's switched off again and listed. It's then off in both plugins: fix it in Snipfire, or switch it back on in the old plugin.
Only snippets that were on in the old plugin are switched over. Imported copies of snippets that were off there stay off; switch them on in Snipfire when you want them.
4. Old shortcodes keep working
After switching over, the old plugin's shortcodes run the Snipfire copy: [wpcode id="…"], [code_snippet id="…"], [fluent_snippet id="…"], [hfcm id="…"], Woody's [wbcr_…_snippet id="…"] shortcodes and Post Snippets' own shortcode names. You don't have to edit a single post. They keep working even after you delete the old plugin.
To see where they're used, or to rewrite them to [snipfire id="…"] anyway, use Tools & Safe Mode → Shortcodes in your content. See Find where shortcodes are used.
5. Remove the old plugin
When everything is switched over and you've checked your site, deactivate and delete the old plugin. Keep it until you've dealt with every Check first snippet.
Imported the same plugin again?
If a snippet changed in the other plugin after you imported it, the import screen shows it as changed in … since, and offers Re-import … changed to refresh the Snipfire copy. Snippets you already imported otherwise show as Imported and aren't imported twice.
From the command line
wp snipfire import-from # list the plugins with snippets
wp snipfire import-from wpcode --dry-run # show what would be imported and how
wp snipfire import-from wpcode # import (switched off)
wp snipfire import-from wpcode --switch # import and switch over
wp snipfire import-from code-snippets --ids=3,7 # only some snippets
Sources: wpcode, code-snippets, fluent-snippets, hfcm, custom-css-js, post-snippets, woody, customizer-css, wpcodebox. See WP-CLI.
Good to know
- HTML that printed
<?phpas text. Some plugins print HTML snippets as plain text, so a<?phpinside was shown, not run. Snipfire escapes it on import so it still prints as text instead of running as PHP. The notes tell you when this happened. - Page caches. After switching over, clear your page cache so visitors get pages built with the Snipfire copies.
- A snippet that fails to import (unreadable, or a type Snipfire can't import yet) is listed with the reason and left alone in the other plugin.
Something unclear or missing? Tell us