You are viewing the OptimizePress 2.0 Help center. Click here for OptimizePress 3.0 support.
  1. Home
  2. Knowledge Base
  3. OptimizeMember
  4. Protecting Non-WordPress content [OptimizeMember]

Protecting Non-WordPress content [OptimizeMember]

f you want to use OptimizeMember to protect content that is being loaded outside of WordPress you can do so by including 
wp-load.php from the WordPress core files.

<code><?php require_once 'wp-load.php';
if(current_user_can('access_optimizemember_level1'))
{
// User is allowed to view, so display something here.
}
else exit('Permission denied!');

This solution uses PHP code and that means the external pages that use this code will need to be PHP files. Files that end in 
.htm or .html will not be able to use this code unless you’ve specifically configured your web server to parse those file types with PHP.

See: How To Parse HTML Files As PHP for more information.

Was this article helpful?

Related Articles

Support Discontinued
As a discontinued platform, OptimizePress 2.0 is no longer officially supported. We recommend upgrading to our new OptimizePress suite. Click the button below to see our latest plans
Upgrade to OptimizePress 3.0