Support » Networking WordPress » What is the hook for that subdomain permissions page?

  • I’ve commented on here before about that permissions error page that comes up (on a subdomain install), when a user at tries to login at

    I want to remove that error message by css so it just leaves ‘dashboard’ and ‘visit site’ by doing:

    #error-page p:nth-of-type(1), #error-page p:nth-of-type(2), #error-page p:nth-of-type(3) {
    display:none !important;

    But I can’t find the hook for it.

    I have the following hooks for adding css on non frontend pages:

    add_action('admin_head', 'am_admin');
    function am_admin() {
       echo '<style type="text/css">
    /*css for admin*/
    add_action('login_head', 'am_signup_register_activate');
    add_action( 'signup_header', 'am_signup_register_activate' );
    add_action('activate_header', 'am_signup_register_activate');
    function am_signup_register_activate() {
       echo '<style type="text/css">
    /*css for other stuff*/

    I’v looked on wordpress hook references but can’t get that permissions page error css code to work.

    Can anyone help me, thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    IIRC it doesn’t have a hook yet.

    Thanks for your reply Ipstenu. I keep trying to find ways of avoiding that permissions error page, it has been bothering me for so long, I have just found this bit of code on the forums if anyone is interested – this redirects back to your Site homepage:

    function go_home(){
       wp_redirect( home_url() );

    Now you can hover over the my-sites link in the top admin bar and go to your blog. Surely this is better if users decide to login through your main site url.

    Also, I noticed when your on someone elses blog, clicking on the my-sites link directly instead of using the my-sites sub menu to go to your blog, you also go to that permissions error page. After looking in admin-bar.php in wp-includes it has:

    foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
    		switch_to_blog( $blog->userblog_id );

    This code is inside the my-sites parent rather than outside so that is why that goes to that permissions error page so I worked out a way to rewrite the code in my functions.php to put that code on the outside, I’m no good with php, I tried a few things and somehow I got it to work perfectly.

    I just thought, is there a way to do the same thing by adding the switch_to_blog line and add_action(‘wp_login’,’go_to_blog’); together somehow?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What is the hook for that subdomain permissions page?’ is closed to new replies.