FeaturesRunCode Snippets
Custom code, managed like a professional codebase
Add PHP, JavaScript, CSS, HTML and JSON snippets from WordPress, with conditions for where and for whom they run, a code editor that checks your code before it runs, versions you can restore, logs of errors and activity, and safe mode for the day something breaks. The AI can write snippets too — always as drafts that a person activates.
- PHP, JavaScript, CSS, HTML and JSON
- Checks before running, automatic shut-off after fatal errors
- Versions, logs, variables, secrets and safe mode
Every snippet, with where it runs
The list shows each snippet’s type, what it does, tags, where it runs and whether it’s on. Turn snippets on and off, filter by type, tag or status, and see errors from the last 24 hours at a glance.
Site Scripts give you quick head, body and footer boxes; Page & element code lists the custom code in pages and elements.
- Search, types, tags and statuses
- Site Scripts for head, body and footer
- Page and element code in one place
Write, test, then activate
The editor highlights and checks code before it runs. A PHP snippet can run on every request, as a hook, a shortcode, a REST endpoint, or once when you click Run now. Choose where (everywhere, the site, admin, specific pages) and who (everyone, logged-in visitors, roles).
Test mode runs a snippet only for you before everyone gets it. A snippet that causes a fatal error is turned off automatically.
- Run modes: every request, hook, shortcode, REST endpoint, run once
- Conditions for where, who and when
- Test mode and automatic shut-off
- Versions with restore
Safe mode, even when you can’t log in
Safe mode stops snippets from running without changing them: PHP snippets only, or all snippets including page and element code. Turn it on for everyone here, add ?nai_safe_mode=1 to any address as an administrator (your browser only), use a recovery link that works when you can’t log in, or set a constant in wp-config.php.
- Safe mode for everyone or one browser
- Recovery links
- wp-config.php constant as a last resort
Code SnippetsEverything included
Everything in code Snippets
Snippets
- PHP, JavaScript, CSS, HTML, JSON
- Run modes for PHP: request, hook, shortcode, REST endpoint, once
- Conditions: where, who, when
- Tags, search and filters
- Import and export
Safety
- Checks before running
- Test mode (only you)
- Automatic shut-off after fatal errors
- Safe mode, recovery links, wp-config constant
- Versions with diff and restore
- Logs of errors and activity
Team
- Separate permissions: see, edit, add, activate, write PHP
- Variables and encrypted secrets (nai_var, nai_secret)
- AI assistant that writes drafts, never activates
Questions about code Snippets
Is Code Snippets required?
No. It’s an optional feature switched on in Settings → Features. Switching it off stops snippets from running and hides the screens; nothing is deleted.
Can the AI activate code on my site?
No. Snippets the AI writes are saved as drafts. A person with the right permission reviews and activates them.
Code SnippetsKnowledge base
How to use it
Step-by-step articles, settings and answers in the knowledge base.
- Custom code in pages and elementsAdd CSS, JavaScript and head or footer code to one page, template or element — it runs only where that page or element appears.
- Code SnippetsAdd PHP, JavaScript, CSS, HTML and JSON snippets from WordPress — written as drafts, tested on the real site only for you, then activated — with an AI code assistant beside the editor.
- Snippet types, run modes and conditionsWhat each snippet type can do — PHP run modes, JavaScript loading, CSS delivery, HTML placement, JSON config — and conditions for where, for whom and when it runs.
- Safe mode and recoveryStop snippets from running without changing them — for everyone, for your browser only, from a recovery link when you can’t log in, or from wp-config.php.
- Variables, secrets, versions and logsKeep values and encrypted secrets out of your code, compare and restore versions, and read what every snippet logged.
Works well with
“Build a website for my plumbing business in Austin.”
Plans the pages and writes them in a look of their own, with a header, footer, templates and a design system you can edit.
“Make every button on the site pill-shaped.”
Finds the shared class behind every button, shows you the plan, then changes it once.
“Write meta descriptions for every page that doesn’t have one.”
Writes them from each page’s own words in a background job, shows the credits first, and puts each one beside its page for you to approve.
“Add an exit-intent popup offering a free consultation.”
A native popup with its trigger and how often it shows. It starts as a draft.
“Which pages lost visitors this month?”
Compares this month with last, page by page, and checks recent changes to those pages.
“Find unfulfilled orders.”
Lists the paid orders waiting to ship, oldest first.
“Write a six-lesson course on home budgeting with a quiz after each lesson.”
Writes the outline, every lesson and the quizzes as drafts for you to review, and sets who can take it.
“Why was a customer locked out this morning?”
Reads the security log, finds the lockout and its address, and can unblock it for you.
“Which plugins need updates?”
Lists the installed plugins and the ones with an update waiting.
“Use the color scheme of this website: https://…”
Opens the site, reads the colors and fonts it uses most, and sets your design system from them.
“Create a Services post type with Price and Duration fields.”
Its own menu in WordPress and custom fields — in ACF when it’s active — ready for a template.
“Add the prices from this PDF to the Services page.”
Reads the attached price list and builds it into the page in your design.
“Count quote requests as a conversion.”
Adds a conversion goal for the form, so Analytics counts every request.
“Show me low-stock products.”
Reads stock from WooCommerce and lists what’s running low or out, with how many are left.
“Refund order 1042 and put the items back in stock.”
Prepares the refund with the amount and how it’s paid back, and waits for your confirmation.
“When someone buys the course bundle, enroll them and tag them in the CRM.”
Builds the automation — the purchase, the enrollment, the CRM tag — as a draft, and asks before switching it on.
“What happened on the site this week?”
Reads the activity record, updates, errors and health checks, and sums them up.
“Add a snippet that turns off comments on pages.”
Writes and checks the code, and saves it as a draft that you switch on.
One plugin. One agent. Your whole site.
Start free: a license for one website and AI credits to build with, no card needed. Describe your business and watch Native WP AI design your home page.





