Skip to content

Instantly share code, notes, and snippets.

@maddisondesigns
Last active September 23, 2026 13:30
Show Gist options
  • Select an option

  • Save maddisondesigns/276af3c3781cde053c4855cd1da37cac to your computer and use it in GitHub Desktop.

Select an option

Save maddisondesigns/276af3c3781cde053c4855cd1da37cac to your computer and use it in GitHub Desktop.
Disable AI Support and Remove Connectors Screen in WordPress
/**
* 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' );
// Disable AI Support
define( 'WP_AI_SUPPORT', false );
@BrookeDot

Copy link
Copy Markdown

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