Prevent public to view profile?

5.74K viewsWordPress
0

is there a way to prevent users from viewing the profiles of other users? like questions asked, etc.

1

You can override user template and add below code:

if(!ap_is_my_profile){
    echo "You cannot view this page";
    return;
}

Check docs for overriding AnsPress

Good solution

which folder do we add this code in?

Please refer to documents about overriding AnsPress theme

You are viewing 1 out of 2 answers, click here to view all answers.