This topic has 1 reply, 2 voices, and was last updated 10 years by SQadmin.

  • Author
  • #2451
     fcm2013
    Participant

    I just logged into the wp-admin using anyone of the user accounts that have signed up as members. All of mine are demo accounts right now but the point is the exposure. Is there anything that can be done to find the wordpress backend?

    #2483
     SQadmin
    Keymaster

    Hi,
    By default wordpress allows users to go to WP Admin.
    This snipped might do the job. Add it to sweetdate-child/function.php

    COPY CODE
    
    add_action( "init", "kleo_blockusers_init" );
    function kleo_blockusers_init() {
        if ( is_admin() AND ! current_user_can( "administrator" ) AND
           ! ( defined( "DOING_AJAX" ) AND DOING_AJAX ) ) {
            wp_redirect( home_url() );
            exit;
        }
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Restrict regular users access to WordPress admin(wp-admin)’ is closed to new replies.

Log in with your credentials

Forgot your details?