I have a area on the website that are for registered users only. I do not want regular users to ever see any of it or know of its existence.
Rather than show a you do not have permission to see this page I would like the user to be redirected to the home page, is that possible?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
You can use the WordPress native hook "template_redirect" in order to redirerct user to home. You can adjust the code as required:
- https://developer.wordpress.org/reference/hooks/template_redirect/
More related links:
- https://stackoverflow.com/questions/49503023/wordpress-restrict-page-by-user-role-url-redirect
Ok I can see how this works.
I would suggest this would be a great thing to add directly to access. As a no code solution being able to set a "post group" for a page and pick a page to redirect to would be fantastic, not just a 404.