It seems strange to put a redirect in a template page, because so much of the page has already been built by the time you reach a custom page template.

I'm wondering what is a good action hook to use where I can test whether the user's logged in, and whether they're on a particular page/category/etc and wp_redirect them if necessary?

1 Answer 1


I'm guessing the built-in template_redirect action is the best for this... :D


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.