WordPress plugin
Code Snippets Pro
Code Snippets gives you a dashboard for creating, organizing, previewing, and managing custom code. The free plugin works with PHP snippets and reusable HTML content. PHP snippets can run everywhere, in the administration area, or on the front end; manually confirmed run-once snippets are available for one-time tasks.
Manage WordPress code as snippets
Code Snippets gives you a dashboard for creating, organizing, previewing, and managing custom code. The free plugin works with PHP snippets and reusable HTML content. PHP snippets can run everywhere, in the administration area, or on the front end; manually confirmed run-once snippets are available for one-time tasks.
Snippets are stored separately from your theme, so changing themes or updating WordPress does not remove them. Code that depends on a particular theme or add-on may still need changes if that dependency changes.
Organize and move your snippets
Use names, descriptions, tags, search, filters, sorting, and bulk actions to manage a collection. Switch between table and card views, preview code without opening the editor, and lock important snippets to help prevent accidental edits or deletion. The Stats overview shows snippet totals and breakdowns by type, run location, and tags.
Export one snippet or several to move them between websites, then import the export file through the Snippets import screen. PHP snippets can also be exported as a PHP file, with their names and descriptions in comments, for use without the plugin. Review exported code before including it in a theme or plugin.
Pro code types and editing utilities
Pro adds CSS and JavaScript snippet types, with integrations for Gutenberg and Elementor. Its AI Agent can draft code from a description: review and refine the proposed plan, approve code generation, then review the generated snippets before activating them.
- Snippet revisions: Compare earlier code with the current version and restore a previous revision.
- Visual display conditions: Set where and when snippets run with a condition editor.
- Blueprints: Generate PHP for common tasks such as custom post types, taxonomies, shortcodes, settings pages, and extra visitor profile fields.
- Role-based permissions: Control who can view, create, edit, or delete snippets.
- Ran on this page: See through the admin bar which snippets executed or produced output on the current request.
Optional Pro insights track PHP execution time and check for potentially risky code patterns. These advisory checks are not a security audit and do not guarantee that code is safe.
Community and connected Cloud processes
Browse community-shared snippets inside WordPress, preview their code, and download snippet types supported by your edition. A personal Cloud library, synchronization, and connected deployment workflows require a Cloud account and the relevant Pro access. Pro can deploy snippets to connected websites and report when website and Cloud copies differ. Selected Pro workflows have interactive demos in the free plugin; using the full tools requires Pro access.
Local PHP and HTML snippets do not require a Cloud account. Review code before activation and use code you trust, since PHP snippets execute on your website.
Troubleshooting and uninstalling
Safe Mode can prevent snippets from running while you investigate a snippet-related failure and work toward recovery. It does not guarantee that every error can be prevented. If you want plugin data removed when deleting Code Snippets, enable Complete Uninstall in the advanced settings before deleting it through the WordPress Plugins screen. Export any snippets you want to keep first.