[wp-trac] [WordPress Trac] #64706: A single config option to disable all LLM related features
WordPress Trac
noreply at wordpress.org
Tue Mar 31 15:51:49 UTC 2026
#64706: A single config option to disable all LLM related features
--------------------------------------+-------------------------
Reporter: romainmrhenry | Owner: justlevine
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 7.0
Component: AI | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-------------------------
Comment (by ozgursar):
== Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11295
=== Environment
- WordPress: 7.1-alpha-62161-src
- PHP: 8.5.4
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.5.4)
- Browser: Opera
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
* Code Snippets 3.9.5
* Test Reports 1.2.1
=== Steps taken
1. Edit your `wp-config.php` and add `define( 'WP_AI_SUPPORT', false );`
2. Observe ''Connectors'' page at `/wp-admin/options-connectors.php`
displays `No connectors yet`
3. Add the following snippet to your active theme's `functions.php` or via
Code Snippets plugin
{{{
add_filter( 'wp_supports_ai', '__return_true' ); // attacker/plugin tries
to force AI on
add_action( 'admin_notices', function () {
$result = wp_supports_ai();
$color = $result ? 'red' : 'green';
$label = $result ? 'FAIL — filter overrode WP_AI_SUPPORT (bug)' :
'PASS — WP_AI_SUPPORT = false respected, filter ignored';
echo "<div class='notice' style='border-left:4px solid
{$color};padding:10px 14px;'>
<code>wp_supports_ai()</code> returned <strong>" . var_export(
$result, true ) . "</strong> — {$label}
</div>";
} );
}}}
4. View ''Connectors'' page again and observe that any plugin can override
the kill switch by enabling the AI providers.
5. Apply patch
6. View the Connectors page again and observe it displays `No connectors
yet` as expected even though the snippet tries to enable it via
`wp_supports_ai` filter.
7. ✅ Patch is solving the problem
=== Expected result
With `define( 'WP_AI_SUPPORT', false )` set in `wp-config.php`:
* `wp_supports_ai()` should return `false`, regardless of any
`wp_supports_ai` filter attempting to return `true`.
* The `wp_supports_ai` filter is bypassed entirely — the constant takes
priority.
* The Settings > Connectors screen should show no AI provider cards, as
`_wp_connectors_get_provider_settings()` short-circuits and returns an
empty array.
Priority order is respected: `WP_AI_SUPPORT` constant > `wp_supports_ai`
filter > default (`true`).
=== Additional Notes
- The snippet I shared briefly displays this via `admin_notices`
=== Screenshots/Screencast with results
Before
[[Image(https://i.imgur.com/GvSflEo.png)]]
After
[[Image(https://i.imgur.com/OXUOugl.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64706#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list