I'm looking for a way to disable Most recent & View all (TABS) on nav-menu.php (in red on the picture).

I want to have only the search bar for my pages and posts.

Thanks. enter image description here


that what i have now :

enter image description here

and that what i want to have :

enter image description here

1 Answer 1


You can introduce a js file exclusively for admin panel doing this in functions.php:

//Admin JS
add_action('admin_init', 'custom_admin_js');
function custom_admin_js() {
    wp_register_script( 'admin-js', get_stylesheet_directory_uri() . '/js/admin.js' );
    wp_enqueue_script( 'admin-js' );

And in admin.js file:

jQuery(document).ready(function($) {
  • I must put admin.js on JS folder at my root installation?
    – Samuel
    Nov 12, 2017 at 16:22
  • No in the theme that you are using in theme folder make another folder called "js" if it doesn't exist and in there make another file called admin.js. Nov 12, 2017 at 16:28
  • thanks. I put the js folder with admin.js inside on my child theme and insert the code (first part) on functions.php but it does not work. can you test the code on your machine please?
    – Samuel
    Nov 12, 2017 at 16:51
  • See changes above i made an edit. Nov 12, 2017 at 17:04
  • Path like this your-theme/js/admin.js Nov 12, 2017 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.