How to return 404 when called edit-comments.php?

There are several ways you can approach this. I wouldn’t recommend deleting edit-comments.php as this is changing the core files, and your changes will be lost when you update WordPress. htaccess 301 Redirect /wp-admin/edit-comments.php http://www.example.com/wp-admin/ OR functions.php Part 1 // Redirect any user trying to access comments page function custom_disable_comments_admin_menu_redirect() { global $pagenow; if ($pagenow … Read more

Add Sortable Column For All Post Types

Why not get all post_types and loop through them with the filter. This should work if the callback for all post types is the same (managesortablecolumns). The code will look something like this: function init_managesortablecolumns (){ $post_types = get_post_types(); foreach( $post_types as $post_type ){ add_filter( ‘manage_edit-‘ . $post_type . ‘_sortable_columns’, ‘managesortablecolumns’ ); } } add_action( … Read more

Change default Posts page

This was answered in a previous question: https://stackoverflow.com/questions/31434373/in-wordpress-how-do-i-set-the-default-admin-sort-order-for-a-custom-post-type-t#answer-31520570 This accepted answer will walk you through how to set up the pre_get_posts callback. That would be my recommendation.