I rely on my draft posts. On a whim, I will often just create a title, write a few notes, and save a draft post with the plan of writing about it in the future. However, I get annoyed having to navigate a few pages in my WordPress admin to get the to draft post section. The Draft post section is under the All Posts menu item. In this tutorial, you’ll learn how to add drafts as menu item to the WordPress admin navigation.
How to Add Drafts as Menu Item to the WordPress Admin Navigation
The WordPress Codex actually gives a guide on how to put together the menu item using the add_posts_page() function. Another good reference is to refer to the adding Administration Menus in the Codex.
Basically the code needs to tell us where you what we are adding, where it will go, who can see this section, and what is the page linking to. Well, I hope I’ve put it in simple terms so most people can understand. Because this isn’t suppose to be an extremely complex tutorial, if you’re a developer, you can refer to the links I shared to the Codex in the previous paragraph.
In order to add draft posts as a menu item to the WordPress admin navigation panel, you will add the following to your theme’s functions.php file.
//* Add menu item for draft posts function add_drafts_admin_menu_item() { // $page_title, $menu_title, $capability, $menu_slug, $callback_function add_posts_page(__('Drafts'), __('Drafts'), 'read', 'edit.php?post_status=draft&post_type=post'); } add_action('admin_menu', 'add_drafts_admin_menu_item');
If you change themes, you will have to re-add the code snippet above back to your functions.php file in the new theme.
Now, you don’t have to add this to your website. This is just something that you do out of personal preference. The menu item will show up in the accordion style menu and the fly out version of the menu.
Of course, there are other ways, like with a plugin.
Dinesh says
Thanks for information…….
Edwin Sydney says
That is great information Nile.Quite innovative and useful for writers.We all do not put down all ideas at one time when we are writing which is useful to use in writing.
Jenn says
Thank you for this! I too live by drafts.
Andrew says
This is cool. Thank you so much Nile for the support. I can add to my new blog now.!
David Bennett says
Handy to know.
Are you aware of any conflicts with Genesis framework? I am guess the answer is no because you use that framework yourself.
As for my work method, I just click ‘all posts’ and that shows the number of drafts – usually the number is four or fewer. I often leave bits of posts hanging around like you do – just a title and the barest of content. I sometimes delete those when the original ‘fire’ that drove me to start them has died down.
I have one post on mercury levels in tuna that has been sitting in drafts for two years or more. I have written a lot in it, as well. Go figure.
Nile says
I have bout 153 posts on draft mode, and it is always increasing… lol. There are no conflicts as the code is a function for the WordPress core.
Sue Bride says
Thanks, Nile, I’m going to use this when I know I’m definitely going to write a post on a topic rather than just writing notes elsewhere. I keep a record of any changes I’ve made to my function files for when I change themes or when I’m not using a child theme.
Nathaniel Kidd says
This is cool and will definitely benefit me with my blog posts. Thanks for sharing.
Dinesh Kumar says
Hello Nile,
I really thank you for sharing such a great article.I confusion with the WordPress admin you just gave me a clear information on drafts, keep posting.
Bob Smith says
Thanks for sharing such an awesome peace of information, i think wordpress should add it by default..
Dinesh sharma says
Hey Nile,
Thanks for sharing valuable information. This post really helpful for online readers. The new navigation menu module in WordPress admin is great.
Thanks for sharing this with us,
Karmakar says
hi Nile,
Thanks a lot for sharing this awesome tips… ๐
A special thanks for the code… Going to try it out.. ๐
Regards…
Sarah Arrow says
Very handy Nile. Like you I often make notes etc in drafts, I tend to use the Editorial Calendar plugin to navigate them though. This looks like a better option.
Muhammad Mairaj says
Hi Nile,
What an amazing and useful post about adding drafts as menu item to the WordPress admin navigation. Thanks for sharing such a lovely post .
Samantha Vermillion says
Hi Nile,
Thanks for sharing this useful snippet to us. I really love wordpress hooks, simplifies all the tasks.
Pamela says
Interesting and informative snippet. Thanks for sharing. I will try to implement it on my WP websites.
Trish says
That’s really helpful! There are a lot menu items I wish I could get to quicker.
Maria says
Hi Nile – This is a great article and really very helpful ! Thanks a lot.
Abdul Wali says
Hi, really nice post, I was looking for help on this issue, and finally I found it here. Thanks!