How do we restrict a user to see a field in a post without registration, after registration the user will be able to see the link.

I have a project in which I have created a post from an excelsheet by a plugin, now I want to hide a field of link with login/register button, after registration the user will able to see this link.

1 Answer 1


I assume you mean on the front end;

    if (is_user_logged_in()) {
        // Only visible when logged in
    } else {
        // Only visible when not logged in

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.