remove actions defined with function(){…} wordpress

Solution:

You are talking about anonymous functions. To remove anonymous functions from filters or actions, you have to use the same function body and priority you used when they were added like so:

// Add it.
add_filter( 'tag', function ( $param ) {
    return $param;
}, 10, 1 );

// Remove it.
remove_filter( 'tag', function ( $param ) {
    return $param;
}, 10 );