Remove wordpress dashboard widgets.

Very good hack to remove wordpress dashboard widgets.

add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’ );

function remove_dashboard_widgets() {
global $wp_meta_boxes;

// Remove the incomming links widget
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_incoming_links’]);

// Removes right now
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);

// Removes  primary dashboard
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]);
// Removes secondary dashboard

unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’]);
}

Advertisements

About Kapil Chugh

In love with PHP and tweaking WordPress. Hungry for Open Source and new technologies. Honest. God-fearing. Happiest when solving problems.
This entry was posted in WordPress and tagged . Bookmark the permalink.

10 Responses to Remove wordpress dashboard widgets.

  1. sex says:

    Greate article. Keep posting such kind of information on your site.
    Im really impressed by it.
    Hi there, You’ve performed a great job. I’ll definitely digg it and in my view recommend
    to my friends. I am confident they’ll be benefited from this website.

  2. This article gives clear idea in favor of the new users of blogging, that genuinely how to do
    blogging.

  3. Thanks so much! I have been looking for this solution for a while. It finally works! 🙂

  4. himanshu says:

    Can you tell me how can i remove widgets created by plugins like wordtube? I can only remove the widgets created by wordpress.. hope to hear shortly..
    thanks

    • Kapil Chugh says:

      There are two ways of doing it

      (1) Either you can remove that thing directly from plugin.If lets say you talk about wordtube plugin you can remove it from admin/dashboard.php page
      (2) Second way is you need to know widget name that plugin is using and you just need to remove like i did
      unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);

      You can contact me on my email in case of any confusion.

  5. Bryce Martin says:

    I whipped this up into a plugin and installed it and it worked great. It did leave 4 boxes on the dashboard of WP 3.0. I’m new to WP and writing plugins for it. I’m assuming that I can remove the last 4 elements on the dashboard?

    I really want to have a plugin that will create custom dashboard for my users. I’m hoping this is the first step in that direction.

    Thanks
    Bryce

  6. Kapil Chugh says:

    Which version of wordpress you are using?

  7. Dan says:

    I use this code and it works on my testing site using MAMP, but it does not work on the remote site. Do you know why this might happen? Would there be any plugin conflicts? I am only using 3 plugins: Events Calendar, Lightbox Plus and Absolute Privacy.

    Any ideas?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s