Skip to content

Instantly share code, notes, and snippets.

@tsertkov
Forked from chrisguitarguy/wp-remove-dashboard.php
Created December 18, 2018 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsertkov/efcfd712a3892c3dd0ca5b427dbd4196 to your computer and use it in GitHub Desktop.
Save tsertkov/efcfd712a3892c3dd0ca5b427dbd4196 to your computer and use it in GitHub Desktop.
Remove all the default WordPress dashboard widgets.
<?php
/*
Plugin Name: Remove Dashboard Meta Boxes
Plugin URI: http://pmg.co/category/wordpress
Description: Removes the default dashboard widgets from the WordPress admin.
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: GPL2
*/
add_action( 'wp_dashboard_setup', 'pmg_rm_meta_boxes' );
function pmg_rm_meta_boxes()
{
/**
* Removes the "Right Now" widget that tells you post/comment counts
* and what theme you're using.
*/
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
/**
* Removes the recent comments widget
*/
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
/**
* Removes the incoming links widget.
*/
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
/**
* Removes the plugins widgets that displays the most popular,
* newest, and recently updated plugins
*/
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
/**
* Removes the quick press widget that allows you post right from the dashboard
*/
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
/**
* Removes the widget containing the list of recent drafts
*/
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
/**
* Removes the "WordPress Blog" widget
*/
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
/**
* Removes the "Other WordPress News" widget
*/
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment