-
Home
-
Anonymous Comment
- Tips
How to Hide the "Anonymous Comments" Meta Box
function plt_hide_anonymous_comments_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Anonymous Comments" meta box.
remove_meta_box('anonymous_comments', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_anonymous_comments_metaboxes', 20);
Where do I put this code?
How to Hide the "Anonymous Comments" Dashboard Widget
function plt_hide_anonymous_comments_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "Anonymous Comments" widget.
remove_meta_box('anonymous_comments', 'dashboard', 'side');
}
add_action('wp_dashboard_setup', 'plt_hide_anonymous_comments_dashboard_widgets', 20);