Halloween Sale 15% off Ends in See the plans

Code Snippets

WordPress Code Snippets Plugin With 3,000+ Ready-Made Snippets

Add custom code to WordPress without editing theme files. Decide exactly where and when each snippet runs, start from 3,000+ ready-made snippets, and never lose a site to a typo.

The list of code snippets in WPIDE

Why use the WPIDE Code Snippets

Every kind of snippet

PHP, JavaScript, CSS, HTML, Universal and Text for free; SCSS and block snippets in the paid plans.

Header, body and footer scripts

Add analytics, verification tags and chat widgets site-wide without editing the theme.

Conditional logic

Run a snippet only for some users, page types, post types, URLs or referrers.

Error safety and safe mode

Broken PHP is refused on save, a failing snippet is switched off, and safe mode pauses them all.

3,000+ snippet library

Ready-made snippets for the admin, security, performance, WooCommerce and more. No account needed.

32 code generators

Fill in a form to get the code for post types, taxonomies, menus, widgets, cron jobs, schema and more.

Put code exactly where it belongs

Run a snippet everywhere, only in the admin or only on the front of the site. Insert it in the header, body or footer, before or after posts, content or a given paragraph, or place it anywhere with a shortcode that takes attributes.

Paid plans add a CSS selector placement, positions by word count, and WooCommerce, Easy Digital Downloads and MemberPress pages.

Choosing where a snippet runs in the WPIDE snippet editor

Run it only when it should

Conditional logic is free: logged-in state, user role, type of page, post type, referrer, taxonomy and page URL. Paid plans add page, template, author, post and user meta, device, browser, operating system, cookies, store pages, the cart, memberships, schedules and country rules.

Conditional logic rules for a snippet in WPIDE

A mistake does not take your site down

A snippet plugin runs your code on every page, so safety matters more than anything else. WPIDE checks PHP when you save and refuses code that would not run. A snippet that fails anyway is switched off automatically, and safe mode skips every snippet until you fix the problem.

  • Broken PHP refused at save time
  • Failing snippets switched off automatically, with an email in the paid plans
  • Safe mode
  • Revisions and a testing mode in the paid plans

Start from 3,000+ ready-made snippets

The WPIDE library has ready-made snippets written and tested by the WPIDE team and the community, from hiding the admin bar to WooCommerce checkout tweaks. Add any of them in one click, or install a whole pack of related snippets. No account needed.

The WPIDE snippet library inside WordPress

32 generators write the code for you

Need a custom post type, a taxonomy, a menu, a widget area or a cron job? Fill in a form and WPIDE writes the snippet, ready to save and run.

Code generators in WPIDE

Switch from another snippet plugin in minutes

WPIDE imports your snippets from WPCode, Code Snippets, Header Footer Code Manager, Post Snippets, Simple Custom CSS & JS and Woody, and exports to JSON. Import, check the list, then deactivate the old plugin.

Code Snippets in each plan

Feature Free Basic Plus Pro Bundle
Unlimited snippetsPHP, JavaScript, CSS, HTML, Universal and Text snippets, as many as you like. Included Included Included Included
Header, body and footer scriptsSite-wide scripts such as analytics or verification tags, without editing the theme. Included Included Included Included
Automatic insertionRun a snippet everywhere, in the header or footer, before or after posts, content or paragraphs, or in the admin. Included Included Included Included
Shortcodes with attributesPlace a snippet anywhere with a shortcode and pass it values. Included Included Included Included
Conditional logicRun a snippet only for logged-in users, some roles, page types, post types, referrers, taxonomies or URLs. Included Included Included Included
32 code generatorsFill in a form to get the code for post types, taxonomies, menus, widgets, cron jobs, schema markup and more. Included Included Included Included
Import and exportBring snippets from WPCode, Code Snippets, Header Footer Code Manager, Post Snippets, Simple Custom CSS & JS and Woody; export to JSON. Included Included Included Included
Error safety and safe modeA snippet that fails is switched off automatically, and safe mode skips every snippet until you fix it. Included Included Included Included
3,000+ snippet libraryReady-made snippets written and tested by the WPIDE team, with no account needed. Included Included Included Included
SCSS and Blocks snippetsWrite SCSS that compiles to CSS, or build a snippet with the block editor. Not included Included Included Included
CSS selector and store locationsInsert before or after any element, after a word count, or in WooCommerce, Easy Digital Downloads and MemberPress pages. Not included Included Included Included
Smart conditional logicMore rules: page, template, author, post and user meta, device, browser, operating system, cookies, store pages, cart and memberships. Not included Included Included Included
Scheduled snippets and devicesRun a snippet between two dates or on a schedule, only on desktop or only on mobile. Not included Included Included Included
RevisionsEvery save is kept; compare two versions and restore one. Not included Included Included Included
Testing modeStage changes so only you see them, then publish them all at once. Not included Included Included Included
Country and continent rulesShow a snippet only to visitors from some countries or continents. Not included Not included Not included Included
robots.txt, ads.txt and service workerEdit robots.txt, ads.txt, app-ads.txt and a service worker from WordPress. Not included Included Included Included

See every plan, price and feature

Code Snippets questions

Why use a snippets plugin instead of editing functions.php?

Code in a theme's functions.php is lost when the theme updates and stops running if you change themes. Snippets live outside the theme, can be switched on and off, and WPIDE checks them and turns off any that fail.

Yes. Unlimited PHP, JavaScript, CSS, HTML, Universal and Text snippets, header and footer scripts, automatic insertion, shortcodes, conditional logic, the 3,000+ library, 32 generators and import are all in the free plugin.

Yes. WPIDE imports from WPCode, Code Snippets, Header Footer Code Manager, Post Snippets, Simple Custom CSS & JS and Woody.

No. Browse and add library snippets from the plugin or from wpide.com/library without signing up. An account is only needed to publish your own snippets.

A snippet only runs where its location and conditions say, so a snippet for one page does not load on the others. Paid plans can also serve CSS and JavaScript snippets as cached files.

Get Started with WPIDE

Install the free plugin from WordPress.org, or try any paid plan free for 14 days.