X

Disable Dragging of Metaboxes Within Admin

Snippets by IsItWP

By default, you can easily drag and change the placement of metaboxes in WordPress dashboard. You can also disable dragging of metaboxes and dashboard widgets in WordPress.

Instructions: Add the following code to the functions.php file of your WordPress theme.

function disable_drag_metabox() {
    wp_deregister_script('postbox');
}
add_action( 'admin_init', 'disable_drag_metabox' );

You may also enjoy styling widgets based on their position in a widget area.

Comments   Leave a Reply

  1. FYI – disabling the postbox script also disabled heartbeat and therefore post locking. (I found this out the hard way)

    1. Hey Mike, thanks for sharing it.

  2. Doesn’t appear to work on WP Version 5.9.2

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!