I want to set up a page with PayPal subscription gate away to my members area. It's a simple page with PayPal button which offer discounted subscription price for the chosen customers only.

Therefore I want to give one time access to it. So when the visitor leaves the page to go to PayPal to start subscription and then return to the page - access will be denied. The new access will be denied even if he/she do not subscribe. In short, it is one time visit. This will stop them spreading this offer all over the net.

Would appreciate if you provide the code or plugin for this. Thanks

  • Hey hey, welcome to WordPress Stack Exchange! We love to help you. But plugin recommendations are off-topic. And coding requests are too broad unless you can show us what you tried yourself so far and where exactly you are stuck. Please visit the help center and learn How to ask a good question. Thank you and good luck – leymannx Apr 27 '19 at 22:02

Although this is not a WP question, it could be done with some PHP/MySQL code. Just the psuedocode:

  • generate a GUID value on each main page visit
  • check if the GUID is already in the GUID database
  • if not, store the GUID in the GUID database
  • if GUID exists in the database, redirect to another page ("you were already here, only one per customer" message)

This requires a GUID database that you get to build. And all of the PHP/MySQL code to implement.

Then, create a template from your theme (and a Child Theme to put it in). Add the code to check/store the GUID to that template.

You could also make it into a plugin, where the plugin checks for the page-id of the page you want to limit, so the plugin only runs on the specific page.

But, again, this is not a WP Development question. You'll have to build it yourself. But it can be done. My approach is only one way; there are probably others discoverable via the googles (or bings or ducks).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.