How to remove an Ajax action

The main issue I was having is that when an ajax request hits not all hooks are being loaded.

I used this code:

$return = array();
foreach( $GLOBALS['wp_actions'] as $action => $count )
{
    $return["message"] .= $action . ", ";
}
wp_send_json($return);

This showed me the hooks that were running before and I got it to work.

I think removing ajax actions on “wp_loaded” is probably best as it seems to be the last hook before admin ajax is hit. If you remove on “admin_init” then you miss the check at the top of the file although that may mean you miss some so maybe it is better to do on admin_init.