How to save reusable PHP and JavaScript snippets for WordPress
Save reusable PHP and JavaScript snippets for WordPress developers, with options for organizing, sharing and inserting them in your editor.
SupaKeeper is published by LunarWerx, the makers of AgentHydra, Copilot AI Productivity Suite, Codex Forecast and Model Odds, which are compared here alongside other tools.
Save each snippet as a named file with a short note, keep PHP and JavaScript apart, and group related pieces so you find them on the next project. Typing #copilotsuite followed by a snippet id inserts the saved snippet template into the conversation. [1]
| Option | What it can do | What to check |
|---|---|---|
| Copilot AI Productivity Suite | Typing #copilotsuite followed by the snippet id inserts the saved snippet into the conversation. [1] | The Free plan costs $0 and allows 20 Copilot insertions a week. [1] Premium costs $6.99 a month and has no limit on insertions. [1] |
| Your current snippet method | The way you store snippets now, such as plain files or a notes app. | Check whether it keeps PHP and JavaScript separate and whether you can insert pieces where you need them. |
| A separate snippet manager | Any other tool that stores code snippets. | Check how it stores files, whether it works with your editor, and whether sharing suits your team. |
What you need before you start
Before you save anything, have a WordPress site or a local copy of one running, so you can check each snippet where it will be used. List the PHP and JavaScript pieces you write again and again, such as code for custom post types, shortcodes, enqueued scripts or small interface changes.
For each piece, keep a short description ready that covers what it does and where it belongs, such as a theme file or a plugin. Choose the code editor you will use, because that choice decides how you store and open the snippets later.
Have a folder structure in mind that separates PHP from JavaScript, and a naming pattern that makes a snippet easy to find months later. Finally, write down the values each snippet needs, such as a post type name or an option key, so the snippet can be reused without guessing at them.
Step by step
- Pick the snippets you reuse. Look at the code you rewrite on more than one project and keep only the pieces that work on their own.
- Split PHP from JavaScript. Server-side PHP and browser-side JavaScript run in different places and need different checks, so store them separately.
- Give each snippet a clear name. Use the task it performs, such as register testimonial post type, instead of a generic label like snippet 3.
- Add a short note at the top of each snippet. Say what it does, which file it belongs in, and which WordPress versions you have used it with.
- Replace site-specific values with placeholders. A clear placeholder lets the same snippet fit a new project without edits to the logic.
- Group related snippets. Put pieces for one kind of work together, such as forms or custom fields, so a whole set can be found at once.
- Store the snippets where you can reach them from every project, and keep a backup copy.
- Review the collection regularly. Remove snippets that no longer match current WordPress or PHP behavior, and update the note whenever you change one.
Tools that can do it
Copilot AI Productivity Suite is a VS Code extension made by LunarWerx, and it uses a proprietary licence. [1] It needs VS Code 1.116.0 or newer, and it is also listed on Open VSX for Cursor, Windsurf and VSCodium. [1] You install it from the VS Code Marketplace as LunarWerx.copilot-suite. [1]
Snippets can sit in nested folders, and you can bundle several into a group that is referenced all at once. [1] Typing #copilotsuite /snippet_id inserts the exact saved snippet template into the conversation. [1] Placeholders such as ${name} or ${name:default} ask you for a value when the snippet is inserted. [1]
You can pin up to five favorite snippets to the VS Code status bar. [1] You can also select several snippets and move them, delete them or insert all their references at once. [1]
Other approaches include keeping snippet files in a project folder under version control, or using a snippet manager from another tool. Check how each one stores files, whether it works with PHP and JavaScript, and whether it fits the editor you already use.
Common mistakes to avoid
Avoid saving snippets without a description. A snippet with no note about where it belongs is hard to reuse on a new site.
Avoid hard-coding site names into the logic. Values such as a custom post type name should be placeholders, so the snippet fits another project without rewriting it.
Avoid mixing PHP and JavaScript in one file. Keeping them apart makes each piece easier to check and reuse.
Avoid keeping only one copy. Store snippets where every project can reach them, and keep a backup.
Avoid putting private values into stored code. Client details and keys should stay out of the snippet body.
Avoid skipping the review. A snippet written for an older WordPress version may need changes before you use it again.
Frequently asked questions
Is Copilot AI Productivity Suite free for WordPress developers?
The Free plan costs $0 and allows 20 Copilot insertions a week. [1] Premium costs $6.99 a month and has no limit on insertions. [1] Check which limit suits how often you insert snippets, and confirm current prices before you commit to a plan.
Does Copilot AI Productivity Suite work with Claude Code or Codex CLI?
A built-in local connection lets Claude Code and Codex CLI use your snippets and groups. [1] If you turn on the slash command export, each snippet is also written out as a slash command file for Claude Code and Codex CLI, and the files stay in sync as you edit. [1] Check that your version of each tool supports the connection before relying on it.
Can Copilot AI Productivity Suite share WordPress snippets with a team?
You can export snippets as JSON or make a share link, and teammates can import it. [1] If you sign in with an account, your snippets, groups and settings sync across your machines. [1] Check how your team handles shared files before sending snippets that contain private values.
Does Copilot AI Productivity Suite send snippet code anywhere?
While VS Code telemetry is on, the extension sends anonymous usage statistics, but never snippet content. [1] Snippet code is the part of your work most likely to contain client details, so keep private values out of the snippet body and use placeholders instead. Check your VS Code telemetry setting and the extension licence before storing code you must keep private.
Is Copilot AI Productivity Suite only for VS Code?
It is a VS Code extension that needs VS Code 1.116.0 or newer, and it is also listed on Open VSX for Cursor, Windsurf and VSCodium. [1] You install it from the VS Code Marketplace as LunarWerx.copilot-suite. [1] Check that your editor version meets the minimum before installing, and confirm that your editor is one of the listed options.
There is a Free plan at $0 that allows 20 Copilot insertions a week. [1]
Try Copilot AI Productivity SuiteSources
Related comparisons
- How to advise customers on AI model upgrades
- How AI community managers answer release date questions
- How to anticipate rate limit interruptions for API integrators
- How to audit agent commands in each session in 2026
- How to audit agent sessions across projects
- Audit What an Agent Ran in Each Session for DevOps
- How freelance coders avoid hitting limits mid-task
- How to avoid hitting the weekly cap for Claude users
- How to avoid running out mid-project in Cursor
- How to budget AI usage per sprint