On remove_meta_box
is a note:
Because you can’t remove a meta box until it’s been added, it’s
important to make sure your call to remove_meta_box() happens in the
right sequence.
WordPress SEO adds meta boxes on add_meta_boxes
action with default priority – 10, which run after admin_init
, so that won’t remove them. Instead you need to hook into add_meta_boxes
, but with lower priority – 11, 12, etc.
function mamaduka_remove_metabox() {
if ( ! current_user_can( 'edit_others_posts' ) )
remove_meta_box( 'wpseo_meta', 'post', 'normal' );
}
add_action( 'add_meta_boxes', 'mamaduka_remove_metabox', 11 );
Related Posts:
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- Add a meta description to home page?
- How to set default screen options?
- Add “upload media” button in meta box field
- Does WordPress have a “Form API”?
- Best practices for meta box placement?
- Sample code for validating custom metabox?
- How to add a class to meta box
- Add Meta box Befoure Post Title
- Block metabox – No expanding, no moving around
- Access the environment of an admin page from another admin page
- Add filter ‘wpautop’ to meta box textarea
- Why can’t I hook into save_posts after admin_init?
- Meta Boxes in Front End Post Submission Form
- add_meta_box does not go ‘side’
- Adding uploaded images to editor from metabox instead of default popup uploader
- How do I stop HTML entities in a custom meta box from being un-htmlentitied?
- Choosing a default page tempate (Classic => Gutenberg)
- meta content on required pages
- get_post_meta doesn’t work
- Add character count to custom metabox
- Update caption for metabox gallery images
- Dynamically Creating Meta Boxes
- Remove border on custom meta box
- Create a page Meta Box listing all blog users
- datetime_timestamp shows numbers only? need in date and time
- remove_meta_box for all post types doesn’t seem to work
- Custom Metabox with Ajax in Edit Post – Stuck
- Post.php – Conditional statements for new post and edit post
- How to generate a featured image from a video embeded in a metabox
- make a excerpt on data from a meta box?
- How to put Periods and Spaces for Array Values (Meta Key)
- How to verify meta box is registered in Unit Testing?
- Add_meta_box not appearing, but does appear in screen options
- Change the post date from a meta box
- update_post_meta and get_post_meta not working
- Customize WordPress Media Upload and New Media Manager Menu in add post Metabox
- Repeatable custom meta fields
- Get all meta boxes values
- How to display a custom post type’s media library inline on meta box
- Modules with meta box implementations
- Metabox saves on Update or Publish, but not on Saving Draft
- Remove meta box for specific page
- Checkbox on a meta box using CMB2 Plugin
- Visual/Text tabs in wp editor Not Showing
- Decide Metabox Configurations for All Users
- metabox select – frontend display
- save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
- Set default post author to none on new post
- Change the context of excerpt metabox for the ‘New Post’ page
- how to save and get selected item id list with add_meta_box
- How to have meta boxes save via REST in Gutenberg?
- Remove anchor tag from meta box link
- Undefined index error in custom post metabox
- WPAlchemy MediaAccess inserting media link in WP Editor instead of custom field in metabox [closed]
- cannot grab post meta from extended Walker_Category class properly
- Resetting admin post form on JS validation fail
- How do you List all Sidebars in a Metabox
- Create more Meta Boxes as needed
- Add a meta box to ALL Pages
- How can i use this meta box function in my template ? (WordPress)
- How to remove some metaboxes for CPTs?
- How to add metabox ONLY to specific WooCommerce product type [closed]
- Why does not my metabox save?
- Add metabox without the container
- wpalchemi metabox doesn’t show value from my post type
- HTML Table creator in metabox to put into post theme
- Display stored value in Meta Box
- How to use Gutenberg in CMB2?
- How to add meta box for current post format?
- How to check specific value in two metabox?
- How to show taxonomy terms from wordpress database?
- How can i get multi checkboxes value in metbox?
- Understanding WordPress’ post type support
- wordpress alchemy put custom metabox on certain page only
- using WPalchemy to output custom metabox from homepage template
- save radio button selection in post-meta on submit
- ShortCut on meta boxes
- Post edit screen: How to check if meta_box is registered?
- How to ‘clone’ select metabox options with a callback function? [closed]
- Saving multiple fields (dropdown and text) in custom metabox
- save meta data of custom post type: WP_Error has no effect, even if insufficient capabilities
- display all registered meta boxes
- where can i see the registered new field for posts using register_meta() ?
- update_post_meta doesn’t work
- how to update editor content from metabox
- Only allow one meta key value per post in a category
- Ridiculous problem with CDATA [duplicate]
- Can’t save drop down select date in meta boxes
- WordPress check if value equals and echo “checked”
- Custom metabox for file upload return empty filename
- Video slideshow
- Meta Box Value not saving / populating?
- How to set default screen options?
- Reload meta box content with AJAX
- Option to delete value in metabox
- why esc_url not working in smartmetabox
- Change Default Custom Fields Metabox Name on cctm plugin
- Form submit from modal window to parent window
- Is there a way to remove the Add boxes from the Screen Options menu metabox?