Google

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

Written on:December 16, 2011
Comments
Add One

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!

Leave a Comment

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>