I’m trying to remove the export.php page from WordPress admin menu -> tools
for a multisite so only the network admin could see it
I have the following code so far but can’t get it to work.
//***************************************************
// Remove export Page
//***************************************************
function remove_menu_export_pages() {
remove_menu_page('export.php');
}
add_action( 'admin_init', 'remove_menu_export_pages' );
How can I solve this?
Whenever in doubt about a WordPress function, consult the Codex: Function_Reference/remove_menu_page.
The correct function is
remove_submenu_page
hooked intoadmin_menu
.And then you’d probably would like to also block the direct access to that page through the URL address (
http://example.com/wp-admin/export.php
):the simple working code is here:
please write this code in your functions.php.
refer: http://prntscr.com/ojcxut