Last active
September 23, 2026 13:30
-
-
Save maddisondesigns/276af3c3781cde053c4855cd1da37cac to your computer and use it in GitHub Desktop.
Disable AI Support and Remove Connectors Screen in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Redirect the new AI Settings > Connectors screen back to the Dashboard so it can't be accessed | |
| */ | |
| function mytheme_admin_redirects() { | |
| global $pagenow; | |
| /* Redirect Connectors screen back to main Dashboard page */ | |
| if( $pagenow == 'options-connectors.php' ) { | |
| wp_redirect( admin_url( '/' ), 301 ); | |
| exit; | |
| } | |
| } | |
| add_action( 'admin_init', 'mytheme_admin_redirects' ); | |
| /** | |
| * Remove the new AI Settings > Connectors page from the WP Dashboard menu | |
| */ | |
| function mytheme_remove_connectors_screen() { | |
| remove_submenu_page( 'options-general.php', 'options-connectors.php' ); | |
| } | |
| add_action( 'admin_init', 'mytheme_remove_connectors_screen' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Disable AI Support | |
| define( 'WP_AI_SUPPORT', false ); |
You can also use the filters - (Apparently Jetpack if installed can override the WP baseline setting):
add_filter( 'wp_supports_ai', '__return_false' );
add_filter( 'jetpack_ai_enabled', '__return_false' );
Setting via constant will override both.
while not directly related to AI, Akismet also uses the connector interface and it can be overridden with:
/**
* Disable Akismet Connector Usage
*/
add_action(
'wp_connectors_init',
function ( $registry ) {
if ( method_exists( $registry, 'is_registered' ) && $registry->is_registered( 'akismet' ) ) {
$registry->unregister( 'akismet' );
}
},
20
); // after Akismet_Connector::register_connector (default priority 10).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case anyone finds it useful, I've refactored @maddisondesigns code to utilise the WP_AI_SUPPORT constant - unless this constant is both defined and set to true, the AI settings screen will be removed from the WP 7+ dashboard: