The preferred method of creating a settings page is to use the WordPress Settings API.
From your code example, it looks like it's too late to remove the admin_notices
hook inside your callback in the admin_menu
hook.
You should try to move the logic from the customfunc()
callback into another callback activated from some earlier hook, for example admin_init
.
Additionally:
You are also calling the new admin menu page settings, but the user might confuse it with the existing Settings page.
ps: The User Levels you have in one of the add_menu_page()
input parameters, are deprecated, use instead some of the Capabilites mentioned here.
So instead use for example:
add_menu_page( 'My settings', 'My settings', 'manage_options', 'custom', 'customfunc' );