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';
// 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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.