Code Snippets
Code Snippets gives you a dedicated WordPress dashboard for creating, organising and managing custom code. Add PHP functionality and reusable HTML content, choose where PHP snippets run, and activate or deactivate snippets individually. Find snippets with search, tags and filters, switch between tab
Code Snippets gives you a dedicated WordPress dashboard for creating, organising and managing custom code. Add PHP functionality and reusable HTML content, choose where PHP snippets run, and activate or deactivate snippets individually.
Find snippets with search, tags and filters, switch between table and card views, and preview code without opening the editor. Lock important snippets to help prevent accidental changes, and use the Stats overview to see snippet totals and breakdowns.
Watch the Code Snippets 4.0 walkthrough
See the plugin in use, including features from both the free and Pro editions. The Pro features listed below require the relevant Pro access.
Want AI-assisted code creation and advanced controls? Code Snippets Pro adds the AI Agent, snippet revisions, visual display conditions, CSS and JavaScript snippets, and connected Cloud workflows.
Your snippets stay separate from your theme files. Browse Community Cloud for shared snippets, and use import and export to reuse your code across sites.
Code Snippets has been available on WordPress.org since 2012 and is active on 1 million+ WordPress installations.
Included in the free plugin
- PHP snippets without editing theme files. Add custom functions and WordPress hooks from your dashboard.
- Reusable HTML content. Create content snippets and insert them into posts and pages with shortcodes.
- Control where PHP runs. Choose everywhere, administration only or front end only. Run-once snippets are available for manually confirmed one-time tasks.
- A built-in code editor. Work with syntax highlighting, code checking and adjustable editor preferences.
- Organised snippet management. Use names, descriptions, tags, search, filters, sorting and bulk actions. Browse in table or card view, preview code without opening the editor, and lock important snippets to help prevent accidental edits or deletion.
- Stats overview. View snippet totals, active and inactive counts, and breakdowns by type, run location and tags.
- Import and export. Move snippets between sites using export files, or export PHP snippets as a PHP file for use without the plugin.