Are you looking for a way to customize the admin menu order? This snippet will allow you to change the order of the admin menu items.
Instructions:
- Add this code to your theme’s functions.php file or in a site-specific plugin.
- Edit the order of the strings in the returned array on lines 4 through 13 to change the order of the admin menu items.
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');
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.
If you liked this code snippet, please consider checking out our other articles on the site like: How to Properly Create a Custom Login Page in WordPress (Step by Step).
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.
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.
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!
I’m having the same problem!
Solved!! Instead of “admin.php?page=chat” put only “chat” – Simple as that!
doesn’t work for me =(
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?
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
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.
Perfect! Most elegant solution on Google, so far
Thanks glad I could help out.
[…] This post was mentioned on Twitter by WPSNIPP. WPSNIPP said: #wordpress Customize admin menu order http://bit.ly/hLr3ga #blog please RT 🙂 […]