In my Admin Panel, I am constantly checking my Posts by state and visitor count via the All Posts link on the lefthand menu bar. My desired URL looks like:


But the default for this link is just


How can I make it so that the default link for my Posts is like the first one?

2 Answers 2


This was answered in a previous question:


This accepted answer will walk you through how to set up the pre_get_posts callback. That would be my recommendation.


Add this to your child theme's function.php:

add_action( 'admin_menu', 'wpse_244328_post_menu' );
function wpse_244328_post_menu() {
    global $submenu;
    $submenu['edit.php'][5][2] = 'edit.php?post_status=publish&post_type=post&orderby=post_views&order=desc';

This will change the default value for the Posts menu from:



  • I love this answer except that when I implement it, it makes my Posts submenu stop working. Is there a way to implement this but still have the submenu appear? Oct 29, 2016 at 17:09
  • Updated the code, submenu will be still be available now. Oct 29, 2016 at 21:32

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.