Skip to:
Content
Pages
Categories
Search
Top
Bottom

Block user from accessing /wp-admin


  • wiktormatata
    Participant

    @wiktormatata

    Hello , i started creating my website using buddypress , when my users login they are redirected to the my profile page. The problem is that they still can access wp dashboard by typing /wp-admin after my page url.

    Is there any way to block access to /wp-admin for non administrators ?

    Thank you for reading , hope someone can help me :/

Viewing 4 replies - 1 through 4 (of 4 total)

  • Anonymous User 18187419
    Inactive

    @anonymized-18187419

    Try “Remove Dashboard Access” plugin, by TrustedLogin.
    Available from WP plugins repository.
    Works fine on my site.


    wiktormatata
    Participant

    @wiktormatata

    Thank you it worked very well for me : D


    yliya14
    Participant

    @yliya14

    `function wph_noadmin() {
    if (is_admin() && !current_user_can(‘administrator’)) {
    wp_redirect(home_url());
    exit;
    } }
    add_action(‘init’, ‘wph_noadmin’);

    Add this code to function.php The code redirects all users except the administrator to the main page of the site when they try to login to the admin panel


    pkings
    Participant

    @pkings

    what about other roles like shop managers, will this also block them out? My site have few other roles that assist with the running of the website but not as administrators.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar