Last active
July 13, 2018 21:57
-
-
Save nathanieltubb/906547ad001054de40eb1ec2c5d92367 to your computer and use it in GitHub Desktop.
WordPress Database Reset All Users' Metabox Locations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Reset all users' metabox placement. This is useful when changing location of existing ACF field groups. | |
-- Run these separately, and replace the table prefix and meta_keys with your own. | |
-- Search for current metabox values: | |
SELECT * | |
FROM wp_usermeta | |
WHERE meta_key | |
LIKE 'meta%' | |
-- Look for the meta-box-order_[post_type_slug] and metaboxhidden_[post_type_slug] keys. | |
-- Run the reset on the necessary rows based on the post type you are targeting. | |
UPDATE wp_usermeta | |
SET meta_value='a:0:{}' | |
WHERE meta_key IN ('meta-box-order_[post_type_slug]','metaboxhidden_[post_type_slug]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment