How To Remove Import/Export Option From Tools?

You may use the hook admin_menu() and function remove_submenu_page()

The solution assumed the following conditions

  • run it in theme functions.php, you may put somewhere else with different tweaking, but the following is proved to work in functions.php
  • you know how to test the user access level by yourself, because the following solution is focus on removing the submenu only
function q364011_remove_tools_menu() {
    // you may add your access rights checking logic here with conditions and then do the following

    remove_submenu_page( 'tools.php', 'export.php' );
    remove_submenu_page( 'tools.php', 'import.php' );
}
add_action( 'admin_menu', 'q364011_remove_tools_menu' );