Remove Permalink Meta Box not working?

I ran into this issue recently on a site that I was modifying for a client. The solution that worked for me was to set a ridiculously high priority for my action hook, like so:

add_action( 'add_meta_boxes', 'mjp_edit_meta_boxes', 999 );

This ensures that the action is executed at the very end of the chain after all of the meta boxes have registered.

Update:

If this isn’t working for you, trying hooking into another action such as admin_menu.

add_action( 'admin_menu', 'mjp_edit_meta_boxes' );