• I am looking for a plugin that will allow me to prevent subscribers from editing their profile, specifically their password. With AGCA, I was able to remove the “User” tab from the left column, however when I log in as a subscriber, I am brought to the “Profile” page where the password can be changed. As a subscriber, once I navigate away from this page, I am not able to go back to it. I was wondering, is there a way to direct a subscriber logging in directly to the dashboard page (or some other page) rather than their profile page?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author cusmin

    (@cusmin)

    Hi!

    Please try to add something like this in your theme’s functions.php

    function disable_user_profile() {
    
        if ( is_admin() ) {
    
            $user = wp_get_current_user();
    
            if ( current_user_can( 'subscriber' ) )
                wp_die( 'You are not allowed to edit the user profile.' );
    
        }
    
    }
    add_action( 'load-profile.php', 'disable_user_profile' );

    To redirect user after logging in, you could probably use something like this:

    function admin_default_page() {
      return '/wp-admin';
    }
    
    add_filter('login_redirect', 'admin_default_page');

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove User Profile editing’ is closed to new replies.