Plugin: Remove the WordPress Dashboard

On my way to doing something else, I came up with this plugin that removes the Dashboard from the admin control panel. Note that the GPL license is longer than the actual plugin. :)



<?php
/*
Plugin Name: Filosofo Remove Dashboard
Plugin URI: https://austinmatzko.com/blog/
Description: Make the Dashboard, that page that takes forever to load when you log in, disappear.
Version: 1.0
Author: Austin Matzko
Author URI: https://austinmatzko.com/blog/
*/


/*  Copyright 2006  Austin Matzko  (email : if.website at gmail.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/


function remove_the_dashboard () {
global $menu, $submenu, $user_ID;
        $the_user = new WP_User($user_ID);
        reset($menu); $page = key($menu);
        while ((__('Dashboard') != $menu[$page][0]) && next($menu))
                $page = key($menu);
        if (__('Dashboard') == $menu[$page][0]) unset($menu[$page]);
        reset($menu); $page = key($menu);
        while (!$the_user->has_cap($menu[$page][1]) && next($menu))
                $page = key($menu);
        if (preg_match('#wp-admin/?(index.php)?$#',$_SERVER['REQUEST_URI']) && ('index.php' != $menu[$page][2]))
                wp_redirect(get_option('siteurl') . '/wp-admin/' . $menu[$page][2]);
}
add_action('admin_menu', 'remove_the_dashboard');
?>

 

36 Comments

  1. What would be the use of this plugin? Isn’t the purpose of the dashboard to be helpful in administering your blog[s]?

  2. There are two reasons this plugin might be helpful to someone:

    1) The Dashboard often takes a long time to load when you login, as it polls the feeds for the developers’ blogs.

    2) Someone might want to trim WordPress down for a more professional purpose; the Dashboard is odd in a small company’s CMS, for example.

  3. Or are you thinking “Dashboard” means the entire admin control panel? I mean just that tab all the way on the left, which you see when you first log in.

  4. I was thinking the term dashboard referred to the entire screen at initial login – with the ‘Latest Activities’, ‘Comments’, ‘Blog Stats’, etc. With this plugin, what would appear in that place? Would it be the same without the rss feeds at the bottom..?

  5. Yeah, that’s the dashboard. Some people don’t like it (I just ignore it). With the plugin activated, it just disappears, and when you log in you go to whatever page is to the right of it (it depends on what user level you are).

  6. hey there,
    I’m interested in using this ‘plugin’ but I dont know what I should do.
    Could you give me a noobs tutorial?

  7. Just copy the code and past it into a file that ends with “php” (like remove-dashboard.php), put it in your wp-content/plugins/ directory, and activate it under “Plugins” in the admin control panel.

  8. Forgot to mention: make sure there’s no space before the first characters or the last characters in the file, because then you’ll get error messages.

  9. Great stuff. The other day, I was just thinking, “Oh, this slow load Dashboard thing has to go! But how, how, how?”. Thanks.

  10. So which version of WP is this for?

  11. 2.0 and newer.

  12. hmmmm, i downloaded this plugin and it works terrific on WordPress Mu, great job Filosofo!!!

    Now, I might be greedy on this, but do you know or have a plugin that I can remove individual subpages? For example in the Manage page, I want to remove Export.

    It would be greatly appreciated if you can share some info. Thanks

  13. I love this idea, but is it possible you could offer a variation of this code that will hide the Dashboard for everyone except Admins, or everyone except Admins and Editors? Ideally there would be an Options page to choose which user levels to hide it from.

  14. Great Plugin. Thank you. It skips the Dashboard and takes me to the

    wp-admin/post-new.php page.

    Can it be configured to go straight to the

    wp-admin/edit-pages.php

    page?

    Thanks, Jeremy

  15. THANKS!

    I use WordPress for some of my client’s sites, and then I teach them how to use it so they can update their own pages. The process is already overwhelming enough, and that dashboard page pushes some people over the edge. I tell them not to look at it, but making it just go away is much better! A lot of what’s on the dashboard is helpful — but all the “WordPress Development Blog” and “Other WordPress News” stuff is just too too much. (And why is it relevant for people who don’t have privileges to change the theme or install new versions of the software?) I wish that content would only show up for adminstrators, but until that happens, this plug-in with be my fix.

  16. I second Nyomi on the #13 comment.

    Great plugin, thanks.

  17. Simple and cool plugin but I agree with Nyomi and Peter, it would be great to hide the Dashboard for everyone except Admins, or everyone except Admins and Editors, based on user level. Thx Filosofo !

  18. Outstanding plugin. I hate the Dash, and had resorted to a drastic hack – just ripping a chunk out of the base php files. This is much neater. Thanks.

  19. I keep the dashboard but edited its content so that it does not have any of the WP news and other BS – I also added my own custom links..why bother with a plugin?

  20. FANtastic plugin!!! THANKS!!!!

    If you do intend to continue development of the the plugin, I also vote for having the option of which page to start from.

    Thanks again!

  21. Is there any plugin that can customize menu but not only the dashboard?

  22. Anyone who wants to be able to show dashboard for the admin only, here is the solution:

    < ?php
    /*
    Plugin Name: Filosofo Remove Dashboard
    Plugin URI: http://www.ilfilosofo.com/blog/
    Description: Make the Dashboard, that page that takes forever to load when you log in, disappear.
    Version: 1.0
    Author: Austin Matzko
    Author URI: http://www.ilfilosofo.com/blog/
    */

    /* Copyright 2006 Austin Matzko (email : if.website at gmail.com)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    */

    function remove_the_dashboard () {
    global $user_level;
    global $menu, $submenu, $user_ID;
    $the_user = new WP_User($user_ID);

    if ($user_level > 9){
    }

    else {

    reset($menu); $page = key($menu);
    while ((__('Dashboard') != $menu[$page][0]) && next($menu))
    $page = key($menu);
    if (__('Dashboard') == $menu[$page][0]) unset($menu[$page]);
    reset($menu); $page = key($menu);
    while (!$the_user->has_cap($menu[$page][1]) && next($menu))
    $page = key($menu);
    if (preg_match('#wp-admin/?(index.php)?$#',$_SERVER['REQUEST_URI']) && ('index.php' != $menu[$page][2]))
    wp_redirect(get_option('siteurl') . '/wp-admin/' . $menu[$page][2]);
    }

    }

    add_action('admin_menu', 'remove_the_dashboard');

    ?>

  23. It looks like when I pasted it it screwded up the single quotes. Just replace all of the single quotes in that code with new single quotes, should work fine.

  24. I noticed when using this plugin that it kills the javascript used in 2.3.1 to add additional fields, etc. Is anyone else having this issue?

  25. I attempted to use your plugin to remove the dashboard; unfortunately I must have done something wrong as I am unable to log into the site now.

    I recieve the following message.

    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /nfs/cust/6/52/41/714256/web/wordpress/wp-content/plugins/remove_dashboard.php on line 2

    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /nfs/cust/6/52/41/714256/web/wordpress/wp-content/plugins/remove_dashboard.php on line 2
    {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24 \par \pard\f1\fs20\par }
    Warning: Cannot modify header information – headers already sent by (output started at /nfs/cust/6/52/41/714256/web/wordpress/wp-content/plugins/remove_dashboard.php:2) in /nfs/cust/6/52/41/714256/web/wordpress/wp-login.php on line 12

    Warning: Cannot modify header information – headers already sent by (output started at /nfs/cust/6/52/41/714256/web/wordpress/wp-content/plugins/remove_dashboard.php:2) in /nfs/cust/6/52/41/714256/web/wordpress/wp-login.php on line 24

    Any idea on how to correct this???

    Thanks,

    Martin

  26. Find this line in wp-admin/menu.php:
    $menu[0] = array(__(‘Dashboard’), ‘read’, ‘index.php’);

    Change the 0 to a number between 1 and 10, then the tab will disappear.

    Personally, I just edited wp-admin/index.php at the very bottom to look like this (commented out the feeds, etc.) and now the dashboard is very clean and helpful. Here is the bottom of the index.php file after changes.

    So the first part above is for the menu tab, the second part is for modifying the dashboard. I like the dashboard menu item, but after I cleaned it up using the comments to kill the busy features.

    Good luck and make sure you back up first!

    —-BEGIN—-

    <!– <?php _e(“Need help with WordPress? Please see our documentation or visit the support forums.”); ?> –>

    I can’t post the actual code, but look for the lines below at the bottom of the file and comment them out as I have done in the line above. That will clean you all up and present a very simple and useful dashboard.

    devnews

    planetnews

  27. It works just fine! Thank you!

  28. Thanks for the great plugin!
    Is there a way to customize so it redirects the user to another page than “Create New Post”? I’m trying to redirect the user to Manage>Pages instead, but cannot figure out what to change…
    Cheers.

    Javier

  29. Can this be used/modified to remove the comments menu tab?

  30. I’m using WordPress 2.6 and to comment out all the “widgets” at the bottom of the “dashboard” page, edit wp-admin/index.php and comment out the line that says:
    <?php wp_dashboard(); ?>

    you can change it to:
    <?php //wp_dashboard(); ?>

    This code snippet is very near the bottom and once you comment it out, refresh your browser and the dashboard widgets will be gone!

  31. Actually, you should be able to filter out unwanted dashboard widgets with the 'wp_dashboard_widgets' filter.

  32. Hi Austin!

    Here’s a very simple mod on your plugin to allow admins to see the dashboard (I know someone else gave one above, but this one’s simpler ;-))

    Just change

    add_action(’admin_menu’, ‘remove_the_dashboard’);

    to

    if (!is_admin()) {
    add_action(’admin_menu’, ‘remove_the_dashboard’);
    }

    Regards,

    Phil

  33. Uhh – cancel my last post…

    It doesn’t seem to work!

    Phil

  34. I just made a little mod to your plugin so that it works with WordPress 2.7 and only shows the dashboard to admins.

    You can check it out at http://bavotasan.com/tidbits/hiding-the-wordpress-dashboard-for-non-admin-users/

  35. perfect – works a treat – thanks :D

  36. hello,

    this plug-in is awesome although i get this error….

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/83/4780783/html/wp-content/plugins/remove-dash/remove-dash.php:11) in /home/content/83/4780783/html/wp-content/plugins/theme-my-login/includes/wp-login-actions.php on line 33

    any suggestions?

Post a Comment

Your email is never shared. Required fields are marked *

*
*

7 Trackbacks