How to turn off AI in WordPress

WordPress 7.0 added built-in support for AI. Out of the box, it doesn’t do anything on its own: nothing is sent to an AI provider until someone connects one under “Settings” → “Connectors”, which I cover in my How to connect Claude, Gemini or ChatGPT to WordPress tutorial.

But maybe you’d rather it wasn’t there at all. Maybe you manage sites for clients who shouldn’t be able to connect a provider, or your organization doesn’t allow AI tools. Maybe you’re morally opposed to AI. There are plenty of valid reasons for wanting to keep your WordPress site free from AI, and fortunately, it’s easy to do so. In this tutorial, we’ll turn off AI in WordPress with a single line of code, or a plugin if you’d rather not touch any code, and go through what that does and doesn’t cover.

I test my tutorials with the latest version of WordPress, but AI functionality is evolving quickly everywhere, and WordPress is no exception. If something looks different on your site, compare your WordPress version with the one listed above. The developer reference for wp_supports_ai() is where I’d look next, since it was the basis for this tutorial and is updated with every release.

Before you start

If you’ve already connected an AI provider, remove its API key first. Go to “Settings” → “Connectors”, and click “Remove and replace” under the API key of each AI provider you’ve connected.

Why now? When AI is turned off, the AI providers disappear from the “Connectors” screen, but any keys you’ve saved stay in the database. With the providers gone, there’s no longer a way to remove them from the admin, and the less you spread your API keys around the better.

Turn off AI in wp-config.php

The most reliable way to turn off AI is a constant in wp-config.php, the configuration file in the root folder of your WordPress install.

  1. Open wp-config.php in a code editor, or through your host’s file manager. Make a copy of it first, so you can put it back if something goes wrong.
  2. Find the line that says /* That’s all, stop editing! Happy publishing. */.
  3. Add this line above it:
define( 'WP_AI_SUPPORT', false );
  1. Save the file.

That’s it! If you go to “Settings” → “Connectors” now, the AI providers are gone. If you have the AI plugin installed, you’ll also see a notice on the “Plugins” screen saying “Your WordPress environment has AI functionality disabled”, and its features won’t load. Since it won’t do anything with AI turned off, you might as well uninstall it. Fewer plugins is always better.

The constant also overrides everything else. A plugin can’t turn AI back on while it’s set to false.

Turn off AI with a filter

If you’d rather not edit wp-config.php, or you want to turn off AI from a plugin, you can use the wp_supports_ai filter instead. The best place for it is a must-use plugin, which WordPress loads before your other plugins.

  1. In the wp-content folder of your WordPress install, create a folder called mu-plugins if there isn’t one already.
  2. In it, create a file called disable-ai.php.
  3. Add this code to the file:
<?php
/**
* Plugin Name: Disable AI
*/
add_filter( 'wp_supports_ai', '__return_false' );
  1. Save the file.

The result is the same as with the constant. Must-use plugins are always active, so there’s nothing to activate, and the plugin shows up under “Plugins” → “Must-Use”.

You might be tempted to put the filter in your theme’s functions.php file instead, but it loads too late. WordPress itself picks up the filter, but the AI plugin checks for AI support before the theme is loaded. You end up with a half-off state, where the AI providers are gone but the AI plugin’s settings are still there. I suspect this will be streamlined in a future release.

Turn off AI with a plugin

If you’d rather not touch any code, the Turn Off AI Features plugin adds a checkbox for it under “Settings” → “General”. Under the hood, it uses the same constant and filter as above. Keep in mind that anyone with access to the admin can uncheck the box or deactivate the plugin, so if you need AI to stay off, use the constant instead.

On WordPress.com

On WordPress.com, all three methods work on the Business and Commerce plans. The plugin is the easiest route, since you can install it like any other plugin. For the other two, create SFTP credentials in your site’s hosting settings, connect with an SFTP app, and edit wp-config.php or add the must-use plugin as described above.

If you’ve turned on SSH access, you can also set the constant with a single WP-CLI command, without opening the file. Don’t leave out --raw, or the value is saved as text and AI stays on:

wp config set WP_AI_SUPPORT false --raw

On the other plans, you don’t have access to your site’s files, so you’ll need to contact WordPress.com support.

On a multisite network

On a multisite network, both the constant and the must-use plugin turn off AI on every site in the network, since all sites share the same wp-config.php and must-use plugins. If you only want to turn off AI on some sites, put the filter in a regular plugin instead and activate it on those sites only. The Turn Off AI Features plugin also works per site.

API keys are saved separately for each site, so remove them on every site where a provider has been connected before you turn off AI.

What’s turned off, and what isn’t

All three methods turn off AI in WordPress itself, and in plugins that use WordPress’s built-in AI features. That covers:

  • The AI providers on the “Connectors” screen, like Anthropic, Google and OpenAI.
  • Every request made through WordPress’s AI client, whether it’s text, images or speech.
  • The official AI plugin, along with its settings page under “Settings” → “AI”.

It doesn’t cover:

  • Plugins with their own AI. Plugins that talk to an AI service directly are only affected if they check WordPress’s setting themselves. Jetpack does, and turns off its AI features along with WordPress’s, but check the settings of any other AI plugins you use to be sure.
  • The “Connectors” screen itself. It’s also used for connections that aren’t AI, like Akismet and Jetpack if you have them installed, so it stays under “Settings”.
  • API keys you’ve already saved. They stay in the database, which is why we removed them first.

Turn AI back on

If you change your mind, remove the line from wp-config.php, delete the disable-ai.php file from the mu-plugins folder, or, if you used the Turn Off AI Features plugin, uncheck its box under “Settings” → “General”. The AI providers show up under “Settings” → “Connectors” again, and you can connect one as usual.