Skip Navigation

[Resolved] Redirect on page with no permision

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 1 voice.

Last updated by Ian 3 weeks, 6 days ago.

Assisted by: Minesh.

Author
Posts
#2808639

Ian

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?

#2808720

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

#2808815

Ian

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.