See WordPress SEO by Yoast: Hide Meta boxes in posts for non-admins
add_action('add_meta_boxes', 'yoast_is_toast', 99);
function yoast_is_toast(){
//capability of 'manage_plugins' equals admin, therefore if NOT administrator
//hide the meta box from all other roles on the following 'post_type'
//such as post, page, custom_post_type, etc
if (!current_user_can('activate_plugins')) {
remove_meta_box('wpseo_meta', 'post_type', 'normal');
}
}
Related Posts:
- How can I add an image upload field directly to a custom write panel?
- Post meta vs separate database tables
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How do i best handle custom plugin page actions?
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- Export data as CSV in back end with proper HTTP headers
- Completely remove WP_Admin_Bar for specific user roles
- Hook the Keydown Event in the TinyMCE Post Editor
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- how to use thickbox in admin?
- How do you create a custom edit.php / edit pages page
- Cancel post save
- Add a jQuery function to admin pages
- Save metabox with multiple checkbox array
- WP Cron doesn’t save or in post body
- Create a clickable name in WP_List_Table for Plugin Admin
- Check if I am in the Admin Panel (wp-admin)?
- How to add custom content under plugin row in WordPress admin plugin list?
- How to put placeholder text in the main post input area?
- How can I free up the memory used by update_post_meta?
- Is there a way to list tags order by post_meta field
- How to load the plugin only when logged in?
- How to redirect to action on custom page within admin section
- Plugin development: get_post_meta is not working [closed]
- WP AJAX is not working, always returns 0
- Add notification bubble notice in navigation using transients
- Act on user meta updated, but only once
- add a class when login
- Add a panel to edit post
- Where should I put “run once” plugin pages?
- How to check if Woocommerce Order number equals to post ID?
- Modify users.php page to create page/post on button clicked
- Issue plugin commands in admin settings page
- update post meta for checkbox in the admin when inserted in the front-end
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- 403 Error when text is pasted in Custom Metabox Textarea
- Problems with: manage_${post_type}_posts_columns
- Global State During an Admin Post
- Render content after post title in wp-admin
- Add a Save Button to Custom Meta Box [duplicate]
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- Prevent third party plugin’s admin page access based on user type
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- Admin – Handle data before creating or updating a post, page or custom post
- wp_filesystem put_contents issue with owner/group
- Doubts about the use of metadata and how this can affect performance on WordPress
- How can I replace content in the WP Admin area before an admin page is rendered?
- update_post_meta not working in a loop
- Get draggable widgets on Edit Post page
- Enqueue script globally
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- How do I link to a php file in my plugin directory?
- WordPress Admin Login Custom Logo
- How to create custom settings page for custom plugin
- 400 Bad Request, in wordpress theme development, wp_ajax
- How to import the css in the plugin admin area?
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Wp-admin Custom User Management
- Admin Subpages without Menu entry
- How to add custom options for plugin into the add post screen – like yoast seo
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- Catching Form Submission in WordPress Admin Panel
- Redirect in WordPress plugin
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- Is it possible to load the css just on my plugin admin page?
- AJAX button with success callback. (Titan Framework)
- Using delete_post_meta for deleting multiple selected options
- Disable Auto-Expanding Menu in WordPress Admin Menus
- How do I force a download in the admin area?
- Get audio metadata on file upload
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- Remove Permalink Meta Box not working?
- How do I duplicate a single post, with all its properties, and save it as a different post?
- Is there a way to add a link with add_post_meta?
- Adjust query on single
- Get cat parameter from admin-ajax
- Why is $_POST empty when saving custom Meta Box?
- WordPress admin panel not working
- register_meta not showing custom post type metabox data in rest api
- Insert, update or remove data from database (usermeta)
- I cant add is_admin control to plugin
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Change Label of custom post type
- Unexpected issue when using attachment_fields_to_edit filter
- Stop unauthorised file access
- How to enable or disable check boxes in custom post type
- Redirect with message after admin_post.php
- Saving post meta
- Displaying Custom Post Meta
- How to display properly exception or echo string after posting in plugin?
- Same header/footer in Admin, across all network sites in multisite
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Forcing ALL plugin Admin menus into a separate menu
- WordPress multiple user roles accessing on their information on one site?
- Loading jQuery library from WordPress admin
- How to prepend a header section to all pages related to my WordPress Plugin
- Insert meta-description into Yoast-SEO input-field via JavaScript