• Hello,

    I have a website where I use various types of user roles (admin, author, subscriber). I have a lot of authors and I want them to have their user/authors profiles available for any visitor of my website (so basically standard configuration).

    I use also subscriber user role to restrict access to some content only for subscribers. So basically subscribers are like customers, so I don’t want anyone to have access to their user profiles even if there is only their name (which is personal data protected by GDPR).

    Removing subscribers from the open (frontend) lists of all users doesn’t solve the problem or adding noindex for all the users, as I don’t want to allow anyone to access subscribers’ profile pages (even by chance) as the direct link would still be there.

    How can I disable public profile page only for user role “subscriber”?

    Help or any suggestions leading to a solutions will be very much appreciated!

    Kind regards,
    Kaz

    • This topic was modified 3 years, 5 months ago by t-p. Reason: Moved to Fixing WordPress from Everything else WordPress
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You could use the “pre_get_users” action to set the “role__not_in” query var to “subscriber”. This will prevent subscribers from being included in any WP_User_query process, including admin requests. To allow subscribers to be listed in the admin area, include a conditional to only set the query var when is_admin() returns false.

    Thread Starter kazimierz87

    (@kazimierz87)

    Thank you for advice. I’ll try to implement it on my website. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Subscribers profile pages’ is closed to new replies.