Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Enabling access for visitors to page restricted by Q&A plugin WordPress


Q&A Lite plugin:
along with main functionality provides restriction management for WP standard user roles (Subscriber, Author, etc.). But it doesn't have support for non-registered users or visitors.

So I need code/function for functions.php that will enable reading access for non-registered visitors to plugin pages like:


Answers (3)


Arnav Joy answers:

Hi Alex ,

you can check if a user is not logged in and then can redirect to him to a custom page whenever he tries to access the page you do not want to show him

suppose you have created a page with the message that "you are not authorized to see this page" and its id is 222 and

suppose the page id is as follows

page page_id 10 12 14

so you can check in the header.php if above page is visited and can redirect user to the page you have created with the message


if( !is_user_logged_in() ) {
if( is_page( 10 ) || is_page( 12 ) || is_page( 14 ) ){

Alex B. comments:

I want to show all kind of pages I mentioned, NOT hide it from the visitor.

Arnav Joy comments:

oh Sorry , i misunderstood the question

Arnav Joy comments:

Hi Alex ,

I checked this plugin and you have to edit one of the plugin file to make that work , This is not the best approach but if you really need to work it out then go to following path:-



line no. 217 and find following function function is_page_allowed( )

then replace this whole function with the following

function is_page_allowed( ) {
if ( !is_user_logged_in() )
return true;
// First find the cap requirement for this page
if ( is_qa_page( 'archive' ) )
$cap = 'read_questions';
else if ( is_qa_page( 'ask' ) )
$cap = 'publish_questions';
else return true; // Always allow for unlisted pages

if ( !is_user_logged_in() )
return $this->visitor_has_cap( $cap );
return current_user_can( $cap );


but remember plugin upgradation will remove all my code ..
so be careful.

Best of luck



Francisco Javier Carazo Gil answers:


Give us real URL to can be able to see what can be written.

Alex B. comments:


This URL can be used for example:


Clifford P answers:

I haven't tried the Lite version, but here's a screenshot of the full version, most recent version. There are options for Visitor.

[[LINK href=""]][[/LINK]]

You can buy the full version for $19, includes 1 month of updates/support.

Hope that helps.

Alex B. comments:

Thanks for the proposition.