I'm using WordPress. I'm setting up various directory pages for registered users at URLs like mysite.org/directory. If a user is not logged in and navigates to that address they'll get:

enter image description here

This message is not useful to users. I would like instead for something like an automatic redirect of anonymous visitors to wp-login.php. Or failing that, simply change the link "Return to home page" with a link to the user login page.

More Info: Using a plugin to restrict access to profiles to logged-in users does not work as the Civi error overrides any page permissions. This is true regardless of the hijack content option.

Also checked out the page redirect extention but it doesn't appear to be for WP.

1 Answer 1


A solution is to restrict access to the WordPress page that you are inserting the directory short code into. A plugin such as 'Members' allows you to restrict access to pages & posts by user role, customize the message visitors see when they do not have permission and provide a login widget.

  • I've tried that plugin and another to attempt this, but the error comes up regardless of whether or not anonymous users are restricted. I also tested with hijack true and false and the result is the same.
    – Tomulent
    Commented Aug 15, 2017 at 15:49
  • I have a similar setup and the page is restricted to two different roles. When someone is not logged in they get the error specified in WordPress here: Settings>Members>Content Permissions. Content permissions are enabled.
    – KilakwaBT
    Commented Aug 15, 2017 at 16:08
  • I'm not sure what I'm doing wrong but I cannot get this plugin to work. Anonymous users still get the old Sorry but we are not able to provide this at the moment. error—no content from the Members plugin appears.
    – Tomulent
    Commented Aug 15, 2017 at 18:18
  • Just want to double check on the page that you have the directory short code on, do you have permissions set to only allow access to specific roles. The plugin should add a box for permissions on the lower part of the edit section of that page. You may want to remove the CiviCRM content to work on the permission issue first and then drop in the CiviCRM content.
    – KilakwaBT
    Commented Aug 15, 2017 at 20:59
  • Yes I have permissions set up correctly. There is no configuration that produces the desired result. This must be a CiviCRM setting.
    – Tomulent
    Commented Aug 16, 2017 at 15:59

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.