X

Customize admin menu order

Adding this PHP code to the functions.php of your wordpress theme will allow you to customize the order of the admin menu items.



Code Snippet:


function custom_menu_order($menu_ord) {
if (!$menu_ord) return true;
return array(
'index.php', // this represents the dashboard link
'edit.php?post_type=events', // this is a custom post type menu
'edit.php?post_type=news',
'edit.php?post_type=articles',
'edit.php?post_type=faqs',
'edit.php?post_type=mentors',
'edit.php?post_type=testimonials',
'edit.php?post_type=services',
'edit.php?post_type=page', // this is the default page menu
'edit.php', // this is the default POST admin menu
);
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');

Comments  Leave a Reply

  1. Do I have to past it into a specific place in the functions.php? I am using the theme Twenty Thirteen and it’s not working for me.

  2. Thanks, it worked like a charm!!! I really didn’t like the default WP Admin order, or top level menu names for that matter, so with the help of your code and another tutorial, I got it pretty much just the way I want it. I think it’s going to be more user-friendly and intuitive for my clients.

    Peace.

  3. Hi Kevin!
    How can I include a menu created by a plug-in into the array?
    I’m trying “admin.php?page=chat” but doesn’t work.

    Thanks!

    1. I’m having the same problem!

    2. Solved!! Instead of “admin.php?page=chat” put only “chat” – Simple as that!

      1. doesn’t work for me =(

  4. Harish Chouhan June 12, 2011 at 10:35 pm

    Hello, Thanks for the script, just one question?

    When using above code, all menus appear below each other. Is there a way to add the divider after few menus just like the default menu in WordPress?

    1. Yes you can do this however it is a little bit of work to get things right. I found a tutorial online that should help you get things going. 

      http://wordpress.stackexchange.com/questions/2666/add-a-separator-to-the-admin-menu

      1. It’s actually really easy if you can live with the default number of separators (i.e. two) – just use ‘separator1’ and ‘separator2’ in the array instead of a php filename.

  5. Perfect! Most elegant solution on Google, so far

    1. Thanks glad I could help out.

  6. Tweets that mention Wordpress Customize admin menu order – wpsnipp.com Wordpress code snippets for your blog -- Topsy.com December 28, 2010 at 5:33 pm

    […] This post was mentioned on Twitter by WPSNIPP. WPSNIPP said: #wordpress Customize admin menu order http://bit.ly/hLr3ga #blog please RT 🙂 […]

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!