

Snippets list with on/off switches, test mode and where each snippet runs.
Custom Code by WALoops: Snippets & AI Code. Pick a ready-made snippet, write your own, or (with Custom Code Pro) describe what you want and the AI writes the code. It is the safe way to add code to WordPress without editing your theme. Paste a tracking script into the header, change how WooCommerce works with a PHP snippet, restyle a page with CSS, or let the Pro AI writer do it for you.
Your snippets survive theme updates, can be switched off with one click, and a broken PHP snippet switches itself off instead of taking your site down.
The number one fear with code snippets is a white screen and a locked-out admin. Custom Code is built so that never sticks:
The AI writer, explainer and fixer are part of Custom Code Pro. The free plugin shows where they live, so you can see what you get.
Describe what you want in plain words, in any language: “show a WhatsApp button under the price on product pages”, “redirect customers to their account after login”, “hide the coupon field on the cart”. The AI picks the right type, location and conditions for your site, writes the code, explains it and tells you how to test it. Its snippet always arrives in test mode.
The library covers what people search for most, each one tested and filled in through a short form:
<body>, footer, as early or as late as possible.Combine rules with AND and OR: page type, post type, specific posts and pages, categories and tags, page template, author, URL, logged-in or not, user role, device, language (WPML and Polylang) and WooCommerce pages (shop, product, cart, checkout, order received, my account).
Place a snippet with the Custom Code block, a native Elementor widget, Bricks element, Beaver Builder module, WPBakery and Avada elements, a classic widget, or the [custom_code id="…"] shortcode in Divi, Oxygen, Breakdance and any other builder.
Active snippets are compiled into files that PHP keeps in memory, so pages run snippets without a single database query. Options per snippet: minify CSS, load CSS or JS as a cached file, defer or async, wait for page ready, and delay scripts until the visitor’s first interaction, which takes heavy chat widgets and pixels off your PageSpeed score.
Attackers who steal an admin login like to hide scripts in snippet plugins. Custom Code makes that hard to miss:
Use {{page_title}}, {{user_first_name}}, {{product_price}} or, on the order received page, {{order_total}}, {{order_currency}}, {{order_items_json}} and {{order_email_hash}} in HTML and JavaScript snippets. Values are escaped for where they land.
Custom Code finds snippets of Code Snippets, WPCode / Insert Headers and Footers, Header Footer Code Manager and Simple Custom CSS and JS on your site and copies them over, switched off until you check them. It also imports Code Snippets export files, and exports your own snippets as JSON.
Pro adds the 16 locked snippets you see in the library (Meta Conversions API, full GA4 e-commerce events, TikTok, Pinterest and Snapchat pixels, Google Ads enhanced conversions, custom checkout fields, payment rules by country and cart, free gifts, quantity discounts, delay all third-party scripts, white-label admin, an exit-intent popup and more), AI that writes about 80–100 snippets a month (no API key needed, or use your own), conditions for schedules, country, UTM source, cookies, cart total and contents and past purchases, unlimited versions with a diff, and a cloud library to reuse snippets on all your sites. See Custom Code Pro.
The free plugin is complete on its own and stays that way: nothing in it is time-limited, and features never move from free to Pro.
Custom Code is made by WALoops, the WhatsApp automation platform for online stores. If you run a WooCommerce store, WALoops sends order updates, Cash on Delivery confirmations and abandoned cart reminders on WhatsApp, with an AI agent and a shared team inbox. The free “Order on WhatsApp” and WhatsApp chat button snippets are a good start.
Custom Code does not connect to any outside service for its features. Optional usage sharing is described below. The AI writer is part of the separate Custom Code Pro add-on, which explains what it sends on its own settings screen and on the privacy page.
Library snippets for analytics and ad platforms (Google, Meta, Microsoft) load those platforms’ scripts on your site once you add and activate them; they are subject to those platforms’ terms.
Usage sharing (optional, off until you allow it) and deactivation feedback: after activation, an admin notice asks whether you want to share usage data with WALoops. Only if you click Allow, the plugin sends to https://app.waloops.com/api/plugin_events.php when you allow it and when the plugin is activated or deactivated: your site’s address, the plugin version, your WordPress, PHP and WooCommerce versions, site language, whether it is a multisite, and an anonymous site ID. When you deactivate the plugin, a short form asks why; if you click Submit & Deactivate, the reason you picked and any text you typed are sent to the same address (with your site’s address only if you allowed usage sharing). Click Skip & Deactivate to send nothing. No customer or personal data is sent. WALoops privacy policy, terms.