I was wondering how to remove the posts section from the wordpress admin sidebar (see image below)
Upon activation, you can head over to Settings » Menu Editor from your WordPress dashboard. Next, you'll see all your menu and submenu items under the 'Admin Menu' tab. You can simply drag and drop your menu items to rearrange their order. There are also options to remove or add new menu items.
If you want to disable the admin bar for any particular user in WordPress, you'll need to edit their user profile. Simply go to the Users » All Users page and then click on the 'edit' link for any user you want to disable the admin bar for.
To delete a web page or blog post, click on the appropriate menu (Pages or Posts) and hover over the one you wish to delete.. On the hover menu, you will see a Trash option. Click this to move the page to the trash.
Go to Settings > Menu Editor. Here you will be able to rearrange, edit, add or delete your admin menu links. You can drag-and-drop all the menu links to a new position. You can also use the toolbar icons across the top to cut, copy, paste and edit each link.
you will be needing to edit functions.php
for this and add some code in that. This section of posts lies as edit.php
See the official wordpress codex documentation for remove_menu_page()
function to understand better. Doc states function usage as:
<?php remove_menu_page( $menu_slug ) ?>
Here $menu_slug
is edit.php
for post menu.
Now create your own function called post_remove()
and add code in functions.php as:
function post_remove () { remove_menu_page('edit.php'); }
The next part is to hook your post_remove()
function with a specific action which in this case is admin_menu
to trigger this function. For that, add some more code in functions.php:
add_action('admin_menu', 'post_remove');
So in short, following is complete code that you need to add in your functions.php file:
function post_remove () //creating functions post_remove for removing menu item { remove_menu_page('edit.php'); } add_action('admin_menu', 'post_remove'); //adding action for triggering function call
Official documentation links
http://codex.wordpress.org/Function_Reference/remove_menu_page http://codex.wordpress.org/Function_Reference/add_action
I hope this helps! Please do me a favor - vote up for my answer and mark it accepted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With