Disabling the WordPress Dashboard – Properly Redirect from Dashboard to any page.

I published some code snippets on an older post for performing this trick. The code was a bit hacky. I have identified some hooks for better implementation in WordPress 3.2 (and probalby previous versions as well.) Here’s the code:

add_action('load-index.php', 'dashboard_Redirect');
function dashboard_Redirect(){
wp_redirect(admin_url('admin.php?page=my-plugin-page'));
}

Nice and easy!

Alternatively, you may choose to redirect to ‘edit.php’ which will take you to a list of all your posts!

Happy coding!

  • Rok

    Nice 🙂

  • Arun

    Super Code Very Nice Thanks Lot

  • sunny

    Very nice Thanks…..