Remove header text option from the backend

This is controlled by theme as part of custom header feature declaration. Something like this should disable that part of the feature (you might need to adjust, depending on specific theme used): add_action( ‘after_setup_theme’, function () { add_theme_support( ‘custom-header’, array( ‘header-text’ => false ) ); } );

Restrict access to admin-post.php

I don’t think that disabling admin-post.php is a good idea. Such solution may break WP, some plugins and themes. But there is another, much simpler solution. Just add your action for admin_post (without nopriv) and process it properly – so if it’s a login action and user is already logged in, redirect him to proper … Read more

Add a unique body class for every admin page (including trash)

You can hook to admin_body_class: add_filter( ‘admin_body_class’, ‘set_admin_page_as_body_class’ ); /** * Create a body class based on the current admin page. * * @param string $classes The current admin body classes. * @return string */ function set_admin_page_as_body_class( $classes ) { /** * For safety, I always check for get_current_screen before I use it. * May … Read more

WordPress admin page not found error

If you don’t have database access for some reason, you can also use // use these in your wp-config.php define( ‘WP_HOME’, ‘http://example.com’ ); define( ‘WP_SITEURL’, ‘http://example.com’ ); or // use these in your functions.php update_option( ‘siteurl’, ‘http://example.com’ ); update_option( ‘home’, ‘http://example.com’ ); to regain access to your site. You can read more about changing the … Read more

Preprocess submitted data

If I got your question right then maybe you could try using the update_option action, which according to the docs “Fires immediately before an option value is updated.”. It gets option, old value and new value as parameters. https://developer.wordpress.org/reference/hooks/update_option/ The accepted answer here, Hook if somebody saves plugin options?, might also be relevant for you. … Read more