• Resolved Expertmedia

    (@erwindetroch)


    the category pages are being indexed by Google and therefor visible to everyone

    you cannot see the posts themselves , but I would like to hide all the content for people that are not logged in … ( so also hide the post titles and the images)

    is that possible?

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

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

    (@caseproof)

    Hi @erwindetroch

    Our Content Permissions tool protects the post content. To protect whole post, you can use the code snippet below and add it at the end of theme’s functions php file:

    add_action( 'template_redirect', function () {
      if ( is_category( 'nice-to-know' ) && ( ! is_user_logged_in() ) ) {
        $redirect = 'https://your-domain.com/wp-login.php'; // Change this to the correct URL
        wp_redirect( $redirect );
        exit;
      }
    } );

    I hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘hide category pages’ is closed to new replies.