Skip to content

Instantly share code, notes, and snippets.

@dexit
Forked from mateitudor/remove_elementor_ai.php
Created July 25, 2025 10:35
Show Gist options
  • Save dexit/a18743bee194e679d0c0083cadbfdf4b to your computer and use it in GitHub Desktop.
Save dexit/a18743bee194e679d0c0083cadbfdf4b to your computer and use it in GitHub Desktop.
Remove Elementor AI including the silly per user checkboxes like "Enable Elementor AI functionality"
function disable_elementor_ai_module() {
if ( class_exists( 'Elementor\Plugin' ) && isset( \Elementor\Plugin::$instance->modules_manager ) ) {
$modules_manager = \Elementor\Plugin::$instance->modules_manager;
// Disable AI module entirely by removing its registration
remove_all_actions( 'personal_options' );
remove_all_actions( 'personal_options_update' );
remove_all_actions( 'edit_user_profile_update' );
// Disable AI option across all users
add_filter( 'pre_update_user_option_elementor_enable_ai', '__return_false' );
add_filter( 'default_option_elementor_enable_ai', '__return_false' );
// Remove any instance of the AI module within Elementor
if ( isset( $modules_manager->modules['ai'] ) ) {
unset( $modules_manager->modules['ai'] );
}
}
}
add_action( 'elementor/init', 'disable_elementor_ai_module', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment