Replace the WordPress Dashboard

When it comes to customizing the WordPress dashboard, you basically have two options:

  1. Customize the widgets that appear on the WordPress dashboard by adding and removing them in the code.
  2. Completely replace the dashboard with your own custom dashboard.

The first option is a great option, but the issue here is that you have no way of removing widgets that may appear in the future due to new plugins being added or existing plugins being updated.  So, if you or your client is picky, then you will probably want to completely replace the WordPress dashboard.

The code below has been tested in WordPress 3.5.1 and should be compatible as far back as WordPress 3.2.  Comments are provided for your convenience as well as instructions on how to customize and use the plugin.

Note that I am checking for the read capability, which will result in the custom dashboard loading for all users.  If you just wanted to display the custom dashboard for subscribers, then just change the capability property to subscriber.  If you want to learn more about how you can customize which users will see the custom dashboard, reference the documentation for the current_user_can() function.

Comments

    1. The code above is setup to be used as a standalone plugin or dropped into a custom plugin. If you drop the file into the WordPress wp-content/plugins directory you should be able to activate the plugin from the ‘Plugins’ -> ‘Installed Plugins’ area in the WordPress admin. The code isn’t really useful on its own, but you should be able to start editing it once you’ve activated the plugin and see your new dashboard changes.

  1. protected $capability = ‘subscriber’;

    does not work? is there an update for this?

    protected $capability = ‘read’; <= seem to only give access to administrator role?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.