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:
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- Completely remove WP_Admin_Bar for specific user roles
- API to trigger prompt on leaving page
- Show message on wordpress admin dashboard
- 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?
- Add a jQuery function to admin pages
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- WP Cron doesn’t save or in post body
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- URLs of plugin resources?
- Problems with removing admin bar
- Check if I am in the Admin Panel (wp-admin)?
- How can I free up the memory used by update_post_meta?
- How to redirect to action on custom page within admin section
- Plugin development: get_post_meta is not working [closed]
- Ordering posts by metadata
- WP AJAX is not working, always returns 0
- Add notification bubble notice in navigation using transients
- Can I individually style items in the backend widget list?
- Act on user meta updated, but only once
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Where should I put “run once” plugin pages?
- How to check if Woocommerce Order number equals to post ID?
- Issue plugin commands in admin settings page
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- maintaing consistent layout wordpress dashboard
- Replacing Scripts in Admin Load_Scripts
- 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
- Saving value of a selection option in comment form as comment meta
- On cliking add new post redirect user to a custom page first
- Add a Save Button to Custom Meta Box [duplicate]
- Plugin with action ‘save_post’ needs to press publish twice on order to publish
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- 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?
- Password field is empty when using wp_signon();
- Run Shortcode of post’s custom field in functions.php / Plugin
- Using ReactJS in the WordPress admin for plugin development
- template_redirect or admin-ajax.php?
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- How to load library scripts in admin from plugins in noConflict wrapper?
- Show error message after exception handled
- Issue with contextual help overwriting existing content
- Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins
- 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
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Displaying “One Time” Notification in Plugins
- Wp-admin Custom User Management
- How to add custom options for plugin into the add post screen – like yoast seo
- Filter for admin (back end) ‘reply to’ comment
- WP nonce field checkbox prints checked=’checked’ outside input field
- Data not insert and update through ajax and jQuery in admin page?
- Redirect in WordPress plugin
- How to add custom view links to wp-admin/post.php?
- Is it possible to load the css just on my plugin admin page?
- AJAX button with success callback. (Titan Framework)
- jQuery UI tab does not work in the plugin page
- Using delete_post_meta for deleting multiple selected options
- Disable Auto-Expanding Menu in WordPress Admin Menus
- Best practice for plugin: always detect admin-ajax call?
- Get audio metadata on file upload
- Submit form to a different PHP file in the same plugin folder
- Plugin can’t be activated [closed]
- Is there a way to add a link with add_post_meta?
- Adjust query on single
- How to add text editor in plugin menu?
- Get cat parameter from admin-ajax
- check_admin_referer()
- How to make an admin plugin menu page go full screen?
- Condition to check previous next article post title
- Add New Button in Admin Panel
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Stop unauthorised file access
- WordPress delete mysql rows with string
- How to display properly exception or echo string after posting in plugin?
- Get (eventual) permalink from post within Edit Post in Admin panel
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- How to add conent (text) to Add New pages form of admin in WordPress
- Issue with iframe in TinyMCE
- Include add_post_meta in a plugin
- Post data in wp-admin to external database
- admin page passing $_POST variables to itself
- modify buddpress adminbar only in admin pages
- Loading jQuery library from WordPress admin
- How to change the headline title for an admin page in a plugin?
- How to prepend a header section to all pages related to my WordPress Plugin
- Load specific CSS file
- How to use native wordpress translation domain inside a custom plugin?
- Select a Text for CSS
- WordPress – Filter users list count