Skip to content

Instantly share code, notes, and snippets.

@chairmanbrando
Last active December 20, 2024 08:56
Show Gist options
  • Save chairmanbrando/320f05c066ee44f89d3e1a595526890f to your computer and use it in GitHub Desktop.
Save chairmanbrando/320f05c066ee44f89d3e1a595526890f to your computer and use it in GitHub Desktop.
Disable Elementor's AI prompts, links, and buttons
<?php
// For whatever reason, returning `false` isn't good enough. 🤷‍♀️
add_filter('get_user_option_elementor_enable_ai', fn () => '0', PHP_INT_MAX);
@chairmanbrando
Copy link
Author

The previous version dequeued the relevant scripts, but that was before Elementor had a per-user setting to disable the AI. Rather than setting it for each user, simply override the value and return "false" for everyone.

@chairmanbrando
Copy link
Author

I forgot PHP has had arrow functions for a bit, so here's one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment