Submit a Gravity Form to Access Content

This plugin provides a simple way to protect your content, requiring the visitor to submit a form in order to gain access.

April 12, 2024: Fixed noticed generated due to PHP 8.2's deprecation of dynamic properties.

January 12, 2023: Added cookie_expiration parameter to allow configuring when the cookie that tracks submitted forms expires.

November 23, 2021: Added gfsa_has_access filter for filtering whether the current viewer has access to a given post.

March 2, 2021: Updated snippet to run as a Singleton plugin. Added gw_submit_to_access()->has_submitted_form() helper method.

June 21, 2017: Improved support for automatically showing required form if no required message is specified.

March 2, 2017: Updated submitted forms cookie to be persistent by default. Added new "is_persistent" option to disable this.

March 1, 2017: Added support for "gwsa_requires_submission_redirect" option to allow automatically redirecting to a specific page if the user requires access.

March 23, 2016: Added support for requiring a form to be submitted before any page can be accessed. Added support for storing submitted forms in user meta.

March 3, 2015: Added support for shortcodes in "gwsa_requires_submission_message" custom field. Fixed issue where json_decode() did not return an array.

You have a post or page you’d like to protect but you don’t want to require the user to sign up for a user account and you just don’t need a full-blown membership system. All you want to do is collect a few details about the user for your mailing list or CRM.

This plugin provides an easy way to accomplish this. Any post-based content (that includes pages and custom post types) that support custom fields can be locked down. You set a few special custom fields and the Gravity Forms Submit to Access plugin takes care of the rest.

Getting Started

  1. Check requirements

  2. Install the plugin

    • Click the “Download Code” button above and save the file to your Desktop.
    • Drop the file into your WordPress plugins folder via FTP – or – zip the file up and upload it via WordPress plugin uploader.
  3. Configure the plugin

    • Read on for step-by-step instructions

Locking Down a Page

  1. Navigate to the Edit screen for any post, page, or any custom post type.

  2. Enable “Custom Fields via the Screen Options at the top of the page. There is a good chance they are already enabled.

    gw-submit-to-access-enable-custom-fields
  3. Add a custom field named gwsa_require_submission with a value of 1.

    gw-submit-to-access-gwsa-require-submission
  4. Add a custom field named gwsa_form_ids and set the value to the ID of whichever form the user should submit to gain access to this page.

    gw-submit-to-access-gwsa-form-ids

That’s it!

Custom Field Options

gw-submit-to-access-custom-field-options
  • gwsa_require_submission (string) (required)

    Add this custom field with a value of 1 to require a Gravity Form to be submitted to gain access. Set this value to per_page to require the submission on the page itself.

  • gwsa_form_ids (bool) (optional)

    Add this custom field and set the value to the ID of the form which must be submitted to gain access to this page. If there are multiple forms that can be submitted to gain access, you may include them as a comma-delimited list (i.e. 1,2,3). If any form can be submitted to gain access to this page, do not add this custom field option.

  • gwsa_requires_submission_message (string) (optional)

    Override the default message that is displayed when the user does not have access to view the content of this page.

    Use the {form} custom merge tag to control where the required form is output alongside the requires submission message. This allows you to wrap the form and message in your own custom markup.

  • gwsa_requires_submission_redirect (string) (optional)

    Provide a URL to which the user will be redirected if they do not have access to view the content of this page.

Per Page Locking

By default, any pages locked by the same form submission will all be unlocked simultaneously. For example, let’s say you lock down two pages on your site, called Welcome New Members and House Rules, and you only want members of your site to be able to view those pages. You can use the same form to unlock both pages by inserting the same Form ID into the gwsa_form_ids field on both pages. When a user submits the form on either of the two pages, both pages are unlocked at the same time.

In some cases, you only want to unlock a page when a form is submitted on that page. In the case of the examples pages above, you might have a simple Terms of Service form that requires the user check a box indicating they have read the terms before they can view the content. If you set the gwsa_require_submission custom field value to per_page instead of 1, the page content is only unlocked when the user submits the form on that specific page.

Global Parameters

  • requires_submission_message (string) (optional)

    Define the default message that is displayed if the user does not have access to the content. This value will be overridden if a post-specific message is set via the gwsa_requires_submission_message custom field option. Defaults to 'Oops! You do not have access to this page.'.

  • bypass_cache (bool) (optional)

    Enabling this option will allow the script to bypass any page/cookie caching by fetching the post content via AJAX. Defaults to false.

  • loading_message (array) (optional)

    If bypass_cache is enabled, this option allows you to control the loading message which is visible while the post content is being fetched via AJAX.

  • is_persistent (bool) (optional)

    The cookie that stores which forms have been submitted for the visitor is persistent by default. Set this to false to make the cookie session-based.

  • enable_user_meta (bool) (optional)

    Set this to true to save submitted forms in the user meta rather than a cookie. Only works for logged-in users.

  • cookie_expiration (bool) (optional)

    Set this to a timestamp (in the future) at which the cookie should expire. For example, to have the cookie expire each night at midnight, set the value to: strtotime( 'midnight tomorrow' ).

Any questions?

This is a bare bones plugin. It uses WordPress’ custom fields UI to handle setting the options and advanced configuration should happen in the plugin.

If this proves to be a popular resource, I’ll be happy to enhance it to be even easier to use.

Comments

    1. Roxy Stoltz
      Roxy Stoltz Staff November 19, 2024 at 1:50 am

      Hey Mitchell,

      We’re going to need to take a closer look at the current configuration to see what’s going on here. Please submit a ticket via our support form so we can take a closer look at your setup and help you further.

  1. Joe K
    Joe K October 14, 2024 at 1:48 am

    Hello! I am using the Gravity Forms plugin and your plugin to gate access to embedded PDFs on post pages. I seem to have an issue where once I submit the gravity form and see the embedded document fine,

    (1) Reloading the post page brings up the form again. (2) Opening other gated documents brings up the form again.

    It is as if the cookie does not save (or the plugin does not recognize) that the form has been submitted. It creates multiple entries with each submission when using same email and info collected in the Gravity Form.

    The desired behavior which seems to be suggested by your documentation is that the user submits their info once and at least for that browser session they do not need to resubmit. Not sure where to set the “global parameters” – not in the custom fields, correct?

    More documentation and examples would be helpful!

    I’m using the following custom fields on each post.

    gwsa_require_submission = 1 gwsa_requires_submission_message = Please provide your information to gain access to the resources on this website. gwsa_form_ids = 1

    https://delrindev.wpenginepowered.com/how-to-maximize-the-property-advantages-of-delrin-acetal-homopolymer-over-acetal-copolymer/

    Reply
    1. Joe K
      Joe K October 14, 2024 at 1:08 pm

      When turning on the bypass_cache, the form seems to hang and not display so it shows the loading spinning wheel.

    2. Scott Ryer
      Scott Ryer Staff October 14, 2024 at 3:30 pm

      I’m unable to reproduce this when I test locally. It sounds like there might be something else at play. If you’re a Gravity Perks customers, drop us a line. We’re happy to dig into this.

  2. Koichiro
    Koichiro September 20, 2024 at 4:09 am

    Hello. This is a great plugin. Thanks. I have a problem.

    I created two forms (FormA FormB). I’m using Elementor to load gravityform on a single page.

    In the FormA page, I’ve inserted the fields for FormA (name and email address).

    In the FormB page, I’ve inserted the video and the fields for FormB (name and email address).

    When I enter the fields in FormA and press the “Submit” button, I want the FormB page (video, name and email address) to be displayed.

    Normally, if there is no submission of FormA, the page contents of FormB should not be displayed, but the video is hidden and FormB (name and email address) is displayed.

    How can I avoid this?

    Please reply.

    Reply
    1. Scott Ryer
      Scott Ryer Staff September 20, 2024 at 10:46 am

      Hi Koichiro,

      By default, the form that requires submission to access will display in place of the page content. To show a different message, enter your message in the gwsa_requires_submission_message custom field. You can see an example of a custom message in our demo.

  3. Craig MacLeod
    Craig MacLeod September 10, 2024 at 1:21 pm

    This works great, except for the home page after I’ve cleared cookies. If the form is not submitted, the home page tries to redirect to the form page, but it does not resolve – just spins. The plugin only seems to work once on the home page. I’m using this for an age-gateway where the user has to confirm age of consent in their province. The form page uses a blank template without the site interface.

    Reply
    1. Matt Andrews
      Matt Andrews Staff September 11, 2024 at 3:06 am

      Hi Craig,

      We’re going to need to take a closer look at this. I have sent you an email requesting further information.

      Best,

  4. Paul Hickman
    Paul Hickman August 3, 2024 at 3:22 am

    Can this work with 3D Flipbook?

    Firstly thanks for a great plugin, I had just got it working with an embedded pdf page when my client decided they wanted a 3D Flipbook instead.

    I can’t see the custom fields. When editing the 3D Flipbook. The option to switch them on is not in Screen Options. I am using the ACF and have added the code mentioned above to functions.php but still cannot seen the fields?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff August 5, 2024 at 6:30 am

      Hi Paul,

      I’m unfamiliar with how the 3D Flipbook works and why custom fields are not showing the in screen option. You could actually use ACF custom fields on the page with the same names to set it up, instead of the WordPress custom fields. However, if you’re still having issues with this, please submit a ticket via our support form, so we can take a closer look at your setup and further assist you.

      Best,

  5. Kurt Kokoruz
    Kurt Kokoruz July 8, 2024 at 3:51 pm

    I am trying to make this plugin work but I must be missing something. I have created a page called “Download Form” and added the shortcode [gravityform id="3" title="false" description="false"] to the page. I have created confirmation page called “PDF Download” and in gravity forms have set this page as my confirmation page. In ACF I have created the fields ‘gwsa_form_ids’ and ‘gwsa_require_submission’ and set these fields to be visible on the Download Form page. I have set gwsa_form_ids to 3 and gwsa_require_submission to 1.

    My “PDF Download” page shows the “Oops! You do not have access to this page.” message and below it, the form again. I have no idea why/how the form is displaying again on this page. The only content on have in the content editor is “PDF Download Link” – I have no idea why the form displays again.

    My hosting provider is Pantheon. I looked through the comments before leaving my question. Can someone please explain what I am not doing correctly to restrict access to my “PDF Download Link” page unless the user has submitted the Gravity Form on my “Download Form” page that uses the shortcode [gravityform id="3" title="false" description="false"] in the content window.

    Reply
    1. Roxy Stoltz
      Roxy Stoltz Staff July 9, 2024 at 4:49 am

      Hey Kurt,

      We’d need to take a closer look at the current configuration to see what’s going on here. If you have an active Gravity Perks License, you can get in touch with us via our support form so we can dig into this.

  6. Tim Reader
    Tim Reader July 3, 2024 at 12:52 pm

    Hi, My issue is that the plugin does not show up in the list of plugins on a remote site. It shows up and I’ve got it working on a local install but not on a remote one. I’ve tested it on about five sites and same thing: visible locally, totally hidden from the plugin list remotely.

    Any idea why? (I’ve done basic diagnostics like deactivating other plugins and everything is up to date on these sites; the local and remote versions match as far as is possible)

    Thanks, Tim

    Reply
    1. Rob Anderson
      Rob Anderson July 3, 2024 at 1:55 pm

      Hi Tim,

      Troubleshooting this is going to require a bit more attention than we can give in the comments. You should be receiving a message from a Support Wizard to assist with this issue.

      Best,

    1. Samuel Bassah
      Samuel Bassah Staff July 1, 2024 at 6:15 am

      Hi KC,

      This could be because you have the ACF Custom Field plugin activated on your website. If so, you can use the ACF custom field to create custom fields for the post type and use it for the same purpose. That said, to show the “Custom field” option in the Screen Option even with ACF activated, add this filter add_filter('acf/settings/remove_wp_meta_box', '__return_false'); to your function.php.

      Best,

  7. Richard G.
    Richard G. June 25, 2024 at 4:32 pm

    Great add-on! Is there a way to get this to work so that it does not go to the confirmation message from the cited form? It’s not great for the end user. It would be better if the gated page just automatically appeared after submission but I can’t do that using redirect in GF form settings because it just reloads the form empty for the post. If I set the form Confirmation Type to Redirect, and enter the post’s URL, I would have to create a new form for each gated blog, which is not realistic. What am I missing. I assume it is my error.

    I just want to gate each blog and once the person completes the form, the blog loads.

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff June 26, 2024 at 1:42 am

      Hi Richard,

      Add a Hidden field to the form and set the default value to {embed_url}. This should populate the Hidden field with the URL of the current page with the form. You can then enter the merge tag of the Hidden field as the confirmation page redirect URL of the form. This should get it working the way you want.

      I hope this helps.

      Best,

  8. Daniel
    Daniel April 30, 2024 at 11:28 am

    First off, great plugin! I have set it up according to the documentation above and it works as expected. However, and this may be my ignorance, is there a way to allow people who have already submitted the form to access the page on refresh or when they come back to the locked page? It works the first time. The form is filled out and submitted and the page redirects to my “locked page”. Everything is fine. However, when I leave the page and try to come back to it I have to fill out the form again. Is this a is_persistent or bypass_cache setting?

    Reply
    1. Scott Ryer
      Scott Ryer Staff April 30, 2024 at 4:56 pm

      Hi Daniel,

      By default, is_persistent is set to true, and the default cookie expiration time is 1 year. As long as the cookie hasn’t been deleted, if a user navigates away from the page and returns any time within the next year, the page shouldn’t be locked.

      It’s possible that the cache is serving up the locked page. You could use the bypass_cache setting to load the post via AJAX. This is a parameter, so it needs to be set in the snippet’s code. You can add the parameter to the last line, like this:

      gw_submit_to_access( array( 'bypass_cache' => true, ) );

  9. Brandon
    Brandon April 17, 2024 at 9:28 am

    I’m not a coder but my WP site is using ACF and I want to use this plugin for my Gravity Forms. What would be the appropriate field type in ACF? I’m not able to enable custom fields on each post type that I am trying to restrict, but rather I wanted to use ACF to enter the custom fields with conditional logic.

    Reply
  10. Henry Roberts
    Henry Roberts April 4, 2024 at 7:57 am

    This plugin has started triggering server errors with PHP8.2 – this is what I see in my server logs:

    [04-Apr-2024 11:08:47 UTC] PHP Deprecated: Creation of dynamic property GW_Submit_Access::$_args is deprecated in /sites/mywebsite.com/files/wp-content/plugins/gw-submit-to-access/gw-submit-to-access.php on line 21

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff April 4, 2024 at 9:23 am

      Hi Henry,

      I’m unable to recreate the issue experiencing. In case it’s been a while you downloaded the plugin, can you get the latest version and see if it resolves the issue. If the issue is still present with the latest version, please send us a message via the support form so we can dig into this on your website.

      Best,

  11. Brock Stevenson
    Brock Stevenson January 26, 2024 at 5:16 pm

    Is it possible to have no message for “gwsa_requires_submission_message”?

    I want to hide the message but there is no target class to allow me to hide the message with CSS.

    Thanks, Brock

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff January 29, 2024 at 7:01 am

      Hi Brock,

      The gwsa_requires_submission_message custom field value accepts HTML tags, so you can insert an inline style to hide the message.

      Best,

    1. David Smith
      David Smith Staff January 10, 2024 at 12:17 pm

      This is possible with the “cookie_expiration” parameter. Quick example:

      php gw_submit_to_access( array( 'cookie_expiration' => strtotime( '+14 days' ), ) );

  12. Grace
    Grace January 2, 2024 at 4:44 pm

    Hello! When I click to add a custom field, either on the forms or on the page itself, the above popup prompting the name and value (step 3) does not pop up for me. What am I doing wrong? I have Advanced Custom Fields installed if that changes things.

    Reply
    1. Dario
      Dario January 3, 2024 at 5:59 am

      We’re not aware of any conflicts with Advanced Custom Fields. If you’re a Gravity Perks customer, we’d be happy to dig in via support.

    2. Scott Ryer
      Scott Ryer Staff May 1, 2024 at 1:08 pm

      Hi Shannon,

      Thanks for posting this workaround. ACF does indeed hide the WP custom fields metabox, and this code shows it again.

      Another workaround is to create ACF Text fields called gwsa_form_ids and gwsa_require_submission. These are compatible with the plugin.

  13. Adrienne
    Adrienne December 1, 2023 at 2:52 pm

    When I add the gwsa_require_submission custom field (with the value of 1 or per_page) I am consistently getting a Divi Builder timeout on the back end and the plugin does not work on the front end. Any ideas on how to fix this?

    Reply
  14. Paul
    Paul November 24, 2023 at 10:03 am

    Hi – Is it possible to use a form on a page that you want to protect rather than having a separate page please? The idea being that we could have a number of page in /protect-pages/ that would show the form when first visited, but only the page content (minus the form) when the form has been submitted?

    Thanks for your help.

    Reply
    1. Scott Ryer
      Scott Ryer Staff November 27, 2023 at 2:32 pm

      Hi Paul,

      Yes, the default behavior of the plugin when the user hasn’t yet submitted the form is to display both a message and the required form. If you want to control that message and form location, you can do so using the gwsa_requires_submission_message parameter.

    1. Scott Ryer
      Scott Ryer Staff November 22, 2023 at 3:04 pm

      Hi Ben,

      This snippet supports locking down posts, pages, and custom post types. You simply need to enable custom fields on the post and add the appropriate fields.

  15. Cat
    Cat October 26, 2023 at 3:56 pm

    I love this plugin, it does exactly what I need it to do. One question though, i don’t know how to style the page since i use elementor as a page builder and this locks the whole page. i want to make it so it doesn’t go all the way to the edges of my page, as you can see here: mylymedoc.com/bookquiz

    any idea how to add margins to it or format it so it’s not so overwhelming?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff October 27, 2023 at 10:11 am

      Hi Cat,

      You can use custom CSS to style the form the way you want. Something like this should get you started;

      // Update '1445' to the Post ID and '2' to the Form ID. .page-id-1445 #gform_wrapper_2{ width: 610px; margin: auto; padding: 60px 0; } }

      Generally, support for our free plugins is limited to license holders, so if you need additional help with this, we’ll need you to submit a support ticket, so we can assist you further.

      Best,

    1. Dario
      Dario October 18, 2023 at 8:21 am

      Hi Sal, the snippet will only gate the content in the page or post (including links to the files) but not the files themselves. If the files are accessed directly, they will be shown to the user.

      Best,

    2. Sal
      Sal October 18, 2023 at 11:13 am

      Thanks Dario – then maybe a solution could be put all the downloadable links into a container, then gate the container.

  16. Matt Peskett
    Matt Peskett August 29, 2023 at 12:12 pm

    Hello, is there a way to get this to work so that I don’t have to include ‘now refresh this page’ in the form’s confirmation message to make it load the locked content? It’s not great for the end user. I’d rather it just automatically appeared after submission but I can’t do that using redirect in GF form settings because it just reloads the form empty for the post (post meaning I also can’t use ‘Page’).

    Thanks

    Matt

    Reply
    1. Matt Andrews
      Matt Andrews Staff August 29, 2023 at 12:37 pm

      Hi Matt,

      If you set the form Confirmation Type to Redirect, and enter the post’s URL, the post should load when the form is submitted.

      If this isn’t happening, can you check to see if cookies are enabled on your browser? Could you also check any caching that you may have on your site? If this isn’t a cookies or caching issue, we’ll need you to submit a support ticket for this, so we can dig into this further. Please note that although the snippet is free to use, you’ll need an active Gravity Perks license for support.

      Best,

  17. Jonathan Weaver
    Jonathan Weaver August 23, 2023 at 2:35 pm

    I would like to use 3 forms for different users but have them open one single page. Can I put 3 forms on 3 pages and have them all open a fourth page that has the content? I have the Constant Contact addon on Gravity forms so my goal is for the forms to open the same page but add users to 3 different lists based on which URL they come in through. Hope that makes sense. Thank you!

    Reply
    1. Dario
      Dario August 23, 2023 at 3:08 pm

      Hi Jonathan, this should be possible by setting the form ID’s in the gwsa_form_ids custom field. If there are multiple forms that can be submitted to gain access, you may include them as a comma-delimited list (i.e. 1,2,3).

      If you’re having any difficulties setting this and if you have an active Gravity Perks license, contact us via our support form, so we can look at your setup and assist you further.

      Best,

  18. Jon
    Jon August 22, 2023 at 6:21 pm

    I have everything set correctly and the form opens the page in Chrome but not in other browsers. Please help. Thank You!!

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff August 23, 2023 at 4:48 am

      Hi Jon,

      Can you check to see if cookies are enabled on the other browsers? If cookies are enabled on the other browsers and this isn’t a cookie related issue, we’ll need you to submit a support ticket for this, so we can dig into this further. Please note that although the snippet is free to use, you’ll need an active Gravity Perks license for support.

      Best,

    2. Jon
      Jon August 23, 2023 at 2:44 pm

      It was the page caching at the server. I added the page to the exempt list and the form worked as expected. Thanks!

  19. Jonathan Trenor
    Jonathan Trenor August 22, 2023 at 7:48 am

    Thanks for this awesome plugin!

    Note that I also had to explicitly exclude the respective pages from the server cache on Flywheel in order for the gated content to show after submitting the form.

    Reply
    1. Kylee Bustamante
      Kylee Bustamante October 25, 2023 at 6:48 pm

      Hi Jonathan,

      Are you able to provide more details on how you were able to exclude the respective pages from the server cache? I’m noticing some unexpected behavior with this plugin that I suspect is Flywheel related but all the settings are so abstracted that I can’t figure out how to do this.

    2. Samuel Bassah
      Samuel Bassah Staff October 26, 2023 at 6:36 am

      Hi Kylee,

      I am not really familiar with how Flywheel cahciing works, so I will leave this for Jonathan to assist you. You may also want to contact Flywheel support to see if they can assist you with this.

      Best,

  20. Mia Jordan
    Mia Jordan August 21, 2023 at 10:16 am

    I apologize if I missed this question, there are ALOT of previous comments to scroll through! Is there a way to have the form display as a popup modal that covers the content instead of replacing it on the page?

    So, if I first enter the page, and popup modal keeps me from interacting with the content unless I fill out the form?

    Thanks for this – it seems like exactly what I need, but I think the client will prefer the popup option if it can be done.

    Reply
    1. Dario
      Dario August 21, 2023 at 10:51 am

      From what I understand, we don’t have any ready solutions to block the page content when using a modal, since the snippet doesn’t handle how the modal works. We use Magnific Popup to handle the modals on our site. It’s a simple JS library that we use to generate popups using custom code in our theme.

      I hope this helps!

  21. Eoin
    Eoin August 17, 2023 at 10:43 am

    I’m having the same issue as https://gravitywiz.com/submit-gravity-form-access-content/comment-page-8/#comment-874719 and the provided solution will not work.

    I have a custom post type that has the required custom fields and displays the content. I need the content to be displayed when the form is submitted.

    Instead of using the Page option in the confirmation (as it’s not relevant – the form is not on a page) I tried using the {referer} merge tag for the redirect option. The form reloads on the post but instead of the content it just shows the form again.

    How can I use this on a custom post type?

    Thanks

    Reply
    1. Matt Andrews
      Matt Andrews Staff August 17, 2023 at 1:26 pm

      Hi Eoin,

      I’m not sure why this isn’t working for you. We’ll need to dig into this further to know what’s happening. I’ll contact you via email to request additional information.

  22. Lindsay
    Lindsay August 14, 2023 at 12:52 pm

    Thank you for this. I had to disable WPRocket caching entirely on the locked page for it to work (even with the bypass_cache variable set to True), but with caching disabled it works great!

    I was curious, are you using this plugin or something else for the popup to download the plugin? Is it one of the Gravity Perks available for purchase? I’d love to implement a similar feature to capture emails for free downloads.

    Reply
    1. Scott Ryer
      Scott Ryer Staff August 14, 2023 at 1:27 pm

      Hi Lindsay,

      Glad to hear you got it working once you bypassed the cache.

      We use Magnific Popup to handle the modals. It’s a simple JS library that we use to generate popups using custom code in our theme.

  23. Brandon
    Brandon June 22, 2023 at 1:06 pm

    How/Where can I set the global parameters? I tried adding them as custom fields, but they’re being ignored.

    Reply
    1. Scott Ryer
      Scott Ryer Staff June 22, 2023 at 3:02 pm

      Hi Brandon,

      Global parameters are added to the snippet itself. Instead of using the plugin version, download the snippet version.

      To use global parameters, you’ll need to make some changes to the last line. Replace this line:

      gw_submit_to_access();

      With this, including any global parameters you want to set:

      gw_submit_to_access( array (
              'is_persistent' => false,
          )
      );

  24. janna
    janna June 13, 2023 at 2:29 pm

    Are there any particular settings for the form? This doesn’t appear to be working for me…the form appears in the post with the requirement message; but when submitted, it just shows the form’s default confirmation message plus the requirement message rather than loading the page content.

    Reply
    1. Scott Ryer
      Scott Ryer Staff June 13, 2023 at 3:29 pm

      Hi Janna,

      You’ll want to set the form’s confirmation page to the page where you’re restricting content. When the form is submitted, it will automatically refresh the page to display the content.

      Confirmation page set to restricted page

    1. Samuel Bassah
      Samuel Bassah Staff June 6, 2023 at 11:43 am

      Hi David,

      I’m unsure about this but the plugin currently only supports hiding the content of the page content or the_content. So if the content from Google are displayed within the_content, it should also hide them. You can give it a try to confirm how it works.

      Best,

  25. Joshua
    Joshua May 10, 2023 at 1:57 pm

    I think I know the answer but I was wondering if this plugin could only hide content coming from the_content or if I could get it to hide template parts as wekk?

    Reply
    1. Dario
      Dario May 10, 2023 at 2:29 pm

      Hi Joshua, it currently only supports hiding the_content. You can contact us via our support form so we can get more information about your use case if you have an Advanced or Pro license.

  26. Mark
    Mark April 6, 2023 at 11:03 am

    Hi All, great plugin. The process is working as expected in that my content is gated and only after submitting the form is it accessible. However, is the form supposed to display when using the “gwsa_requires_submission_message” field and the {form} merge tag? I only see my message and “{form}” on the frontend. Do I need an additional plugin or setting?

    Reply
  27. Brad
    Brad February 3, 2023 at 6:59 am

    Followed the setup instructions; nothing works except for the page being correctly blocked. 1. Gravity forms submission doesn’t work. Throws an error for a functional form. 2. Incorrectly displays 3x of the same form. 3. Terrible styling of the block page with no obvious way to improve it.

    Reply
    1. Dario
      Dario February 3, 2023 at 8:33 am

      Hi Brad,

      Based on what you describe, the issue could be related to another code conflicting with the snippet. If you have an active Gravity Perks Advanced or Pro license, you can contact us via our support form.

      Best,

  28. Marcos
    Marcos November 22, 2022 at 4:14 pm

    Hello,

    First of all, thanks for the plugin. I am trying to lock the blog archives post page, but it does not seem to work. It only works on other pages. Is there a limitation on the archive page?

    Reply
    1. Scott Ryer
      Scott Ryer Staff November 22, 2022 at 6:35 pm

      Hi Marcos,

      Currently the plugin doesn’t support locking the blog Posts page. I’m going to log it as a feature request.

  29. Greg Wilson
    Greg Wilson October 20, 2022 at 4:30 pm

    Hello,

    So I added the custom fields to my page I want to protect with the appropriate values – using ACF, but when I load the page I want to protect – it does not take me to the gravity form they need to fill out to get access. It just does nothing. Acts like normal.. Is there some obivous thing I’m forgetting? Thanks!

    Greg

    Reply
    1. Scott Ryer
      Scott Ryer Staff October 20, 2022 at 5:19 pm

      Hi Greg,

      As long as both the gwsa_form_ids and gwsa_require_submission custom fields have the appropriate values on the page, it should work. Do note that if you have already submitted the form with your user, you’ll need to delete those entries and clear your session cookies in order to test.

      If all of those conditions are met and you’re still having trouble and you’re a Gravity Perks subscriber, drop us a line and we’ll be happy to dig into it.

    2. Greg Wilson
      Greg Wilson October 20, 2022 at 5:27 pm

      Hmmm, I have those fields/values configured correctly… Is it because I chose value type as number that it’s not working? Maybe I should just leave it as text? I’m not a subscriber, but is it free to sign up? Thanks!!

    3. Greg Wilson
      Greg Wilson October 21, 2022 at 10:18 am

      Yes, I installed Gravity Forms Submit to Access Version 1.11 by Gravity Wiz. But I have to install Gravity Perks as well? Thanks,

      Greg

    4. Samuel Bassah
      Samuel Bassah Staff October 21, 2022 at 10:52 am

      Hi Greg,

      You do not need the Gravity Perks plugin to use the Submit to Access plugin. However, support is only available to customers with a Gravity Perks license. If you have a license you can get in touch with us via our support form so we can assist you further.

      Best,

  30. aaron
    aaron September 21, 2022 at 11:51 pm

    Hi,

    Using this with Elementor and Woocommerce – with the form on the checkout page (disclosure form) – when submitted the page refreshes and adds a “?” to the end of the url. The checkout does not load, says “you do not have permission to view this page” – when refreshed – page loads fine?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff September 22, 2022 at 6:07 am

      Hi Aaron,

      Do you have the checkout page set as the confirmation page of the form? If not, please do that and check if it works for you but if this doesn’t work, then we’ll need to dig into this further. You can get in touch with us via our support form, if you have an active Gravity Perks license, so we can assist you further.

      Best,

  31. Aleem
    Aleem August 8, 2022 at 9:53 am

    How can I create a form with gated content? (A downloadable) also want to integrate with sendgrid.

    waiting for your response

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff August 8, 2022 at 10:41 am

      Hi Aleem,

      You can use the snippet in this tutorial to create the gated content to a page with the link to download what they want. If this snippet wouldn’t work for you and you have a specific use case, you can get in touch with us via our support form, if you have an active Gravity Perks license so we can assist you further.

      Best,

  32. Gaston
    Gaston July 18, 2022 at 8:32 am

    If I understand correctly, users should complete the form to “register” and then must complete it to access the content, right? Is there any possibility that the content is unlocked directly when it is completed for the first time? Something like unlock on submission. Thanks again.

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff July 18, 2022 at 10:30 am

      Hi Gatson,

      By default, the page should be unlocked when the form is submitted the first time. I’ll suggest you set the page as the confirmation page of the form so that when the form is submitted, they would be redirected to the same page but this time they would get access to the form since they already submitted it.

      Best,

    2. Dario Space
      Dario Space July 18, 2022 at 11:24 am

      Hi Gaston,

      If the snippet setup is correct, it should work. If you have an active Gravity Perks license, you can get in touch with us via our support form so we can assist you further.

      Cheers,

    1. Dario Space
      Dario Space July 14, 2022 at 3:38 pm

      Hi Gaston,

      You should be able to enable AJAX in the form editor as with any form if you are not using a shortcode.

      Best,

  33. Cierra
    Cierra June 15, 2022 at 8:40 pm

    Hi! This plugin is awesome, but for some reason my hidden content only shows if the user has been logged into the admin side of the site itself even if I have submitted the form? the cookie gwsa cookie is being stored correctly but only shows the hidden content if the wordpress log in cookie is stored as well. Wondering if there is a fix for this

    Thanks, Cierra

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff June 16, 2022 at 6:34 am

      Hi Cierra,

      I’m not really sure what’s happening and we may need to dig further to confirm why it isn’t working for you. One thing you can do on your end is to exclude that page from being cached. You may also want to get in touch with your hosting provider and have them exclude the page from being cached on their end too. If it’s still not working, then you can get in touch with us via our support form if you have an active Gravity Perks license, so we can dig into this further.

      Best,

  34. Aaron
    Aaron June 14, 2022 at 2:48 pm

    As a future feature, would you consider adjusting the plugin to allow the display of the form title and description? I see in the plugin code the gravity_form function is set to disable those. It would be great if those settings were optional instead.

    In the meantime I’ve had to edit the plugin to allow those to pass through. My client wanted the signup form to appear as a popup on the same page, and so those extra text elements make a big difference.

    Otherwise, I really appreciate what you’ve built. Worked well for my use.

    Cheers.

    Reply
    1. Scott Ryer
      Scott Ryer Staff June 14, 2022 at 3:39 pm

      Hi Aaron,

      I’m glad to hear you were able to put together a solution.

      Thanks for the feedback. I’ll pass it on to our product manager.

    1. Samuel Bassah
      Samuel Bassah Staff June 14, 2022 at 8:57 am

      Hi Meredith,

      We do not have documentation on that. However, I think if you set up a Payment addon feed on the form, it will request the user makes a payment before they can submit the form and get access to the page.

      Best,

  35. CB
    CB June 9, 2022 at 12:11 pm

    This plugin is great. The only problem is that as an administrator I am unable to see the pages also. All pages are set to redirect to a form page if they have not filled it out. Is there a way to make administrators exempt from this when they are logged in?

    Reply
    1. Dario Space
      Dario Space June 9, 2022 at 12:22 pm

      Hi CB,

      This is currently not supported and it will require some customization to the snippet and snippet customization is only available to our Pro Customers. So if you have an active Gravity Perks Pro license, you can get in touch via our support form so we can get our developers to look into your requests.

      Best,

  36. James
    James May 23, 2022 at 1:09 pm

    Hi there, Thanks for the plugin! In my case the user is submitting the form and the confirmation is redirecting to the same page. Is it possible for the form to be hidden if the user has already submitted it? Thanks, James

    Reply
    1. Dario Space
      Dario Space May 23, 2022 at 1:13 pm

      Hi James,

      The issue you describe seems related to the cache. You can try the Cache Busting plugin and if that doesn’t work and you have an active Gravity Perks license, you can reach us out via support.

      Best,

  37. Christina
    Christina May 18, 2022 at 11:57 am

    How can I have the form submission redirect to the same page (page that the form was on) after? I have a form on a CPT page that shows a video once the form is submitted.

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff May 18, 2022 at 12:25 pm

      Hi Christina,

      You’ll have to set the confirmation page of the form to the same page. This way when the form is submitted it reloads the page but this time the user would get access to the content.

      Best,

    1. Samuel Bassah
      Samuel Bassah Staff May 12, 2022 at 6:07 am

      Hi Bryan,

      There isn’t any known issue using Recaptcha with this snippet. If you’re experiencing any issues using Recaptcha on the gated form when using the snippet, then you can get in touch with us via our support form, if you have an active Gravity Perks License, so we can dig into this issue.

      Best,

  38. Jodi
    Jodi May 7, 2022 at 4:57 am

    Thank you for this plugin! I had some trouble, but eventually got it sorted so I thought I’d leave some feedback in case it helps others.

    1. First, I couldn’t find Custom Fields – it’s in a different spot in the Gutenberg editor (the screen shot shows the classic editor)

    2. I still couldn’t find them and found out that if you have ACF active with Gutenberg, they don’t show. I just ended up creating the fields in ACF, but I found this snippet you can use to restore the default custom fields, if you want https://plugin-planet.com/fix-custom-fields-not-showing-wordpress/

    3. I had an issue where it just showed the confirmation message, but not the page. I realized I needed to set the confirmation to redirect. That might seem obvious, but it’s not in the instructions. I normally just use the confirmation text so it didn’t occur to me right away that I needed to change that.

    Reply
    1. Marty
      Marty December 7, 2022 at 11:32 pm

      Really appreciate the heads up about ACF, I was scratching my head. Hopefully the content can be updated in the documentation to reflect this and the new block editor.

  39. Greg
    Greg May 5, 2022 at 9:57 pm

    Can’t seem to get this to function properly-

    Have Page A with a Form on it- form is set to Redirect to Page B, Page B is set to redirect to page A, if a user hasn’t filled out the form already.

    Results in an infinite loop- despite filling out the Form- cookies never seem to get set, and so it redirects from Page A to Page B, then page B redirects right back to A.

    WP engine site- and WP Rocket is installed- I set settings to never cache the gwsa cookie, and never cache any of the pages involved- but still can’t make it work correctly. Any ideas?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff May 6, 2022 at 5:45 am

      Hi Greg,

      I’m guessing this has to do with WP Engine caching. Can you please try the following and see if it helps. Can you get in touch with the WP Engine support and have them exclude Page A and Page B from being cached and see if that helps.

      Best,

  40. Ron Genius
    Ron Genius April 15, 2022 at 8:05 am

    How do you make it so that they must submit the form every time they access the page meaning when they leave the page and return to the page in the same session or in a new session, they must submit the form again in order to access the page again. I do not want the access regulated by “cookie” since cookie functionality is wonkie depending on device/browser, instead, I would like them to have to submit the form every single time they access the page regardless of session. I have a mobile phone number OTP verification field in the form so that only mobile phone numbers that are in my database can submit the form. Again, how do you make it so that they must submit the form every time they access the page meaning when they leave the page and return to the page in the same session or in a new session, they must submit the form again in order to access the page again?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff April 15, 2022 at 8:31 am

      Hi Ron,

      If you set the is_persistent parameter of the configuration to false, site visitors will be required to resubmit the form if they leave the page and return to the page later.

      Best,

    1. Scott Ryer
      Scott Ryer Staff April 6, 2022 at 2:56 pm

      Hi Melissa,

      This snippet should work with Divi page Builder. We’ve tested it locally and had great results.

      If you’re Gravity Perks subscriber, drop us a line in support and we’ll be happy to dig into this for you.

  41. Derrick M
    Derrick M March 26, 2022 at 10:07 pm

    The gwsa_requires_submission_message override doesnt work.

    Please be thorough before you post and wast people’s time. Thanks

    gwsa_requires_submission_message DOES NOT WORK

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff March 28, 2022 at 7:15 am

      Hi Derrick,

      It’s unfortunate it didn’t work for you. I just tested the code snippet and can confirm it works. We’ll be happy to assist you to get it working if you get in touch with us via our Support Form.

      Best,

    1. Dario Space
      Dario Space March 24, 2022 at 5:08 pm

      Hi Aaron,

      When testing locally it seems to work as expected. If you have an active Gravity Perks License, you can get in touch with us via our support form and we’ll be happy to dig into this further.

      Best,

  42. Bill
    Bill February 17, 2022 at 8:09 pm

    We’re experiencing a bug with the plugin in Safari, Chrome, Opera and Firefox on Mac. For some reason the bug does not manifest in Brave.

    When the user submits the form, instead of being taken directly to the content page, the form is just blanked out. When the user clicks submit again, they are taken to the page.

    Any idea what can be causing this?

    Reply
  43. Nick
    Nick February 1, 2022 at 1:06 pm

    Hi,

    The plugin is working great – but only seems to hide the_content() – I also use ACF to display a link to a PDF and an image that links through to a pdf. Both of these are displaying next to the form. Can the form be configured to display on it’s own page, or alternatively is there a way to hide the output of ACF fields as well as the_content()?

    Thanks!

    Reply
    1. Dario Space
      Dario Space February 1, 2022 at 1:13 pm

      Hi Nick,

      This will require some customization of the snippet. If you have an active Gravity Perks license, you can send us a message via our support so we can take a closer look at your use case.

      Cheers,

  44. Bryan
    Bryan January 14, 2022 at 5:34 pm

    We are running into the same issues with a submission causing the user to return to the initial page and not the thank you page.

    Are there any suggested fixes, I see in the comments others have ran into this but doesn’t seem to be any clear fix (apologies if I’m missing it).

    Thanks in advance for any help!

    Reply
    1. Dario Space
      Dario Space January 16, 2022 at 10:42 am

      Hi Bryan,

      Historically these issues are related to the cache.

      If you have an active Gravity Perks License, you can get in touch with us via our support form so can dig into this.

      Best,

  45. Ben Eppard
    Ben Eppard January 13, 2022 at 12:45 pm

    This works great for me in Chrome, but in some other browsers (Firefox for example) I am consistently redirected back to the page with the Gravity Form. My guess is the cookie isn’t being properly stored, so the form sends the user to the appropriate page of content via GF confirmation redirect, but then the gated content sends the user back to the page where the form is hosted because it can’t find the cookie.

    It occurs to me that this would always be the case for the increasing number of people who block cookies.

    Is there a way to exempt the cookie redirect from the page with the gated content, when the user arrives via the GF confirmation redirect?

    Obviously this would mean users blocking cookies will always have to fill out the form, but it’s better than a redirect loop.

    Thanks!

    Reply
    1. Dario Space
      Dario Space January 13, 2022 at 12:48 pm

      Hi Ben,

      When testing on Firefox it seems to work as well, it should work on any browser but as you mention it relies on the store cookie. If you have an active Gravity Perks License, you can get in touch with us via our support form so can dig into this.

      Cheers,

  46. Vicky
    Vicky December 2, 2021 at 10:21 pm

    I have used this plugin with a simple 1-question gravity form (email, required field). But my client now wants to ask more questions, and some questions only appear based on other question’s answers (conditionals). When using this new gravity form, the form does not want to display on the page (the wrapper of the form style is set to display:none on page load, and when manually overwriting it to display:block, all of the questions appear–meaning the display conditionals are not working– but the conditional logic behind submitting the form is there.

    When setting the page to password-protected, the form loads and works fine (conditionals work). Once the page is set to normal (published), no password, it has the errors. I have also tried using this on a blank page and with my theme builder (Divi).

    I have played with the bypass_cache to see if it was an ajax thing, but that didn’t make any difference.

    Any idea whats going on here or how I can make the form work properly on a regular published page?

    Reply
    1. Dario Space
      Dario Space December 3, 2021 at 9:42 am

      Hi Vicky,

      I can’t confirm why it is not working, it could be related to Conditional Logic or with how the form is embedded with Divi. If you have a Gravity Perks License, you can get in touch with us via our support form so we can take your request and forward it to our developers to see if this can be supported.

    1. Samuel Bassah
      Samuel Bassah Staff November 25, 2021 at 5:55 am

      If I understand correctly, you want to lock down the entire page including the sidebar. The best way to lock down the page content including the sidebar is to redirect to another page when a locked page is accessed. To do this, set the “gwsa_requires_submission_redirect” custom field on your restricted page and set the value to the page the user should be redirected to gain access to the restricted page.

      I hope this helps.

      Best,

    2. Developer Mode
      Developer Mode November 25, 2021 at 8:22 pm

      Hello folks, I wanted to hide/show my sidebar content accordingly if the form completed. It is possible to hide first my sidebar content and after the form completed it will show? Note: Not the entire page/post will restrict, only the sidebar content I want to be restrict.

      Thank you folks.

    3. David Smith
      David Smith Staff November 26, 2021 at 6:46 pm

      We don’t have a ready method for this. The simplest path forward would be to add a custom wrapper to your sidebar like so:

      if ( gw_submit_to_access()->has_access( $post_id ) ) { // Your sidebar! }

      After the form is submitted, refresh the page and the sidebar should appear.

  47. Vicky
    Vicky November 8, 2021 at 2:36 pm

    Thank you for this plugin! I am having a minor issue. I am asking for just an email with my gravity form. When the form is displayed, that field (email) is not using autofill/suggestions (when you click the email input box, it does not give any suggestions of emails you have used on other forms). Any idea on how to get this feature?

    Reply
    1. Dario Space
      Dario Space November 8, 2021 at 2:38 pm

      Hi Vicky,

      Can you replicate this behavior across browsers? Locally it seems to be working as expected.

      If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.

      Cheers,

  48. inzamam
    inzamam October 22, 2021 at 3:15 pm

    Hi, I have tried Gravity Forms Submit to Access But its not working. after setting up post type.

    I am using this with learndash courses. My main purpose is to ask user to submit gravity form and then access the course

    Thanks

    Reply
    1. Dario Space
      Dario Space October 22, 2021 at 3:29 pm

      Hi Inzaman,

      When testing locally, it seems to work as expected. It should work on Post, Pages, and Custom Post Types.

      If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.

      Best,

    2. Inzamam Abbasi
      Inzamam Abbasi October 23, 2021 at 9:27 am

      Thank you for your reply unfortunatly my license is support expired i thought it could help.

      I deactivate all other plugins and just runing gravity forms Gravity Forms Submit to Access Leandash

      I am using Siteground hosting

      Thank you

    3. Inzamam Abbasi
      Inzamam Abbasi October 23, 2021 at 10:43 am

      I just test it working with post and pages issue only with learndash its not working with that.. thanks

    4. Dario Space
      Dario Space October 24, 2021 at 5:48 pm

      Hi Inzamam,

      Thanks for the heads up.

      If Learndash is using WordPress Custom Post Types, the snippet should work as well. Historically, issues with this snippet are related to the cache.

      Cheers,

  49. P
    P October 22, 2021 at 9:44 am

    Hi!

    Does the code no longer need to be edited and the .zip uploaded as a its own plugin? Confused by the copy stating to download code but button says download plugin..

    TIA

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff October 22, 2021 at 9:48 am

      Hi,

      The code can be edited and zipped and installed as a plugin or you can copy and paste the code into your function.php file or a Code snippet plugin.

      Best

  50. Michael Knepher
    Michael Knepher September 24, 2021 at 1:35 am

    Had this working on some private pages for testing – a landing page with a form that redirects to the gated post. The gated post has gwsa_form_ids set to the GF form, gwsa_require_submission set to 1, and gwsa_requires_submission_redirect set to the landing page with the form. This afternoon the client made the pages public and reported that the gated page was redirecting back to the form page. I double-checked the settings based on the instructions above, and set up on a local instance with all settings identical, and it worked as expected.

    On the live site, using Firefox, if I have been logged in to wordpress (and have session cookies set), the process works, but if I’m in a private window it does not.

    On the local site, it works whether there are session cookies or not (i.e., even in a private window).

    Reply
    1. Dario Space
      Dario Space September 24, 2021 at 10:37 am

      Hi Michael,

      Thanks for reaching out. It should work on a private window as well.

      If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.

      Best,

    2. Michael Knepher
      Michael Knepher September 24, 2021 at 12:51 pm

      Hi Dario,

      Thanks for the reply. Before I approach the client regarding escalating support, are you aware of any conflicts this might have with WPEngine?

    3. Dario Space
      Dario Space September 24, 2021 at 1:27 pm

      Hi Michael,

      From what I understand, the snippet should work with WP Engine and most hosting providers.

      If you encounter any setbacks let us know and we will try to help!

      Best,

  51. Morten
    Morten September 16, 2021 at 6:09 pm

    Can this be used to protect only a part of a page? ie. If I have a full page with lots of details but I only want to protect the download links on my page with a form?

    Reply
    1. Dario Space
      Dario Space September 17, 2021 at 10:07 am

      Hi Morten,

      This snippet currently only works to protect the entire Post or Page.

      If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.

      Best,

  52. Rocio S
    Rocio S July 11, 2021 at 4:38 am

    Great plugin but with Gravity Forms version 2.5.6 I now get a blank white screen when I click on the page in WP admin. The frontend works fine, it’s only in admin and only on the pages that are using the Custom Fields for this plugin and the latest version of Gravity Forms.

    No problems prior to the GF upgrade.

    Reply
    1. Dario Space
      Dario Space July 12, 2021 at 10:52 am

      Hi Rocio,

      I’m having trouble reproducing this issue locally, it seems to be working. Could you try updating to the latest GF version which is 2.5.7. If you have an active Gravity Perks License, can you open a ticket with us via our support form, with your account email so that our developers can take a look into it.

      Best,

    2. Rocio Santillana
      Rocio Santillana July 13, 2021 at 8:02 am

      Hi Dario, Thank you for the quick response. I realize that the issue was that the cookie was not set. Once the cookie was set the “blank/white” screen for my locked pages in WP admin showed up just fine. Not a real issue, and great little plugin.

      Thanks again! R

  53. Michael
    Michael April 24, 2021 at 12:23 am

    I’ve used this before with a form on a separate page, but I’m trying to use it for multiple pages that load a specified form in place.

    The problem is once submitted, the Gravity Forms confirmation message is displayed, but it does not then load the page content. One must reload the page.

    Is there a way to just have it display the page content on the form submission without showing the confirmation message at all?

    I thought that’s what setting a custom field of ‘bypass_cache’ with a value of ‘true’ would do, but it does not seem to.

    I must be missing something. Please advise.

    Reply
    1. Michael
      Michael April 24, 2021 at 12:29 am

      Actually, I changed the confirmation to type Redirect of {embed_url}, and that seems to do the trick. Is that the correct way?

      Is the ‘bypass_cache’ with a value of ‘true’ still needed? Not clear how that works or why it’s needed.

    2. Dario Space
      Dario Space April 25, 2021 at 2:23 pm

      Hi Michael,

      Enabling bypass_cache option will allow the script to bypass any page/cookie caching by fetching the post content via AJAX. Setting the bypass_cache will load the contents via AJAX without a page reload. If bypass_cache is enabled, the loading_message parameter allows you to control the loading message which is visible while the post content is being fetched via AJAX.

      If you are a Gravity Perks customer, drop us a line and we’ll be happy to dig into this to see if this is possible.

    3. Ryan
      Ryan October 1, 2024 at 7:04 pm

      I also wanted to say thanks on that embed URL redirect trick. Saved me from having to set up multiple forms for each page it appeared on. :-)

  54. MickE
    MickE March 7, 2021 at 8:13 pm

    Hi guys, I’m having a problem getting this to work using Beaver Builder, the fields are created using ACF (basic text fields), I just never get the form before the content. Going on other comments this appears to be working fine with DIVI or Elementor so wondering if anyone has got this to work with Beaver Builder or anything I may be missing, any advice much appreciated. I also have no caching enabled at the moment as the site is in dev.

    Reply
  55. Carl
    Carl November 25, 2020 at 3:59 am

    Hi! Thanks for providing the plugin!

    I have set up the custom fields on my custom post type after form submission it will just redirect to the restriction message so they still can’t access the protected content.

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff November 25, 2020 at 6:59 am

      Hi Carl,

      If you already have custom fields parameters set up correctly as described in the tutorial above, try clearing the cache and see if that resolves the issue. You could also run a theme/plugin conflict test to check if another plugin is causing this issue.

      In case this doesn’t work for you, then we may have to log in to your site to check the setup and troubleshoot the issue there. So if you have a Gravity Perks license, you can reach us via our support form so we dig into this.

      Best,

  56. Kenneth Kanyi
    Kenneth Kanyi November 17, 2020 at 1:43 pm

    Hi! Thanks for providing the plugin!!!

    Are there any known compatibility issues with Elementor Website Builder?

    Once I add the custom fields, save the page, I can’t edit the page (or the fields) anymore. I also get this error “The editor has encountered an unexpected error.”

    Thanks for your help,

    Ken

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff November 18, 2020 at 6:53 am

      Hi Kenneth,

      The snippet shouldn’t cause any issue with Elementor. It could be with the way you’re creating the custom fields. You may want to check out this article on how to add custom fields in Elementor. If you have a Gravity Perks License and you’re still having issues, you can send us a message via our support form so that we can dig into this.

      Best,

    2. Grant Bivens
      Grant Bivens December 16, 2020 at 2:51 pm

      This is the same behavior I see when working with Divi Page Builder. The issue is you haven’t submitted the form and set a cookie in your browser giving you access to the page you are trying to edit. Just go submit your access form to set a cookie then return to edit your locked content page. The problem lies in that Elementor (as well as Divi) is loading the full page and not just the WordPress text editor thus getting blocked by the submit to access perk.

  57. HW
    HW October 28, 2020 at 5:06 pm

    Hi there,

    I’ve set this up and have the form on the same page with text confirmation. I’ve discovered with multiple people testing that if there is an ad blocker activated on the browser then the content doesn’t immediately show up on form submission, it shows the confirmation text for the form and you have to refresh the page. When no adblocker is activated for the page, the content shows up immediately after form submission and bypasses the form confirmation text which is ideal. Any ideas on how to get this to not be affected by the adblockers considering majority of people do use them these days?

    Thanks!

    Reply
    1. Ryan Donovan
      Ryan Donovan October 28, 2020 at 5:59 pm

      Hello HW, This is a bit of a strange one as I have not run into this issue with my testing. Since their are so many different ad blockers that all have different manners of blocking this kind of information it is a bit of a hard one to pinpoint how to get around certain ones. Do you have an example of the adblocker you are using? Thanks!

    2. HW
      HW October 29, 2020 at 10:17 am

      So this turned out to actually be WPEngine caching the cookie. I do have to redirect back to the same page on submission though to avoid seeing the confirmation message first instead of content but that is a fine solution here. Works with the adblocker too so thats good news.

      Another Q I have for this, is there any way it can lock down the content of the whole page including sidebars instead of just the_content() ?

      Thanks so much!

    3. Ryan Donovan
      Ryan Donovan October 29, 2020 at 10:39 am

      Hello HW, Awesome to hear that the page is working. Second, you may be able to modify the plugin to include the page as a whole but we currently do not have a ready made solution for that. Currently, the plugin is just created to block the Gravity Form in question. Let us know if you have any other questions.

  58. Shannon DeWitt
    Shannon DeWitt September 26, 2020 at 10:35 pm

    Could it also redirect to the RETRICTED PAGE from the FORM page if it has already been completed once, so the user does not see it and think they have to complete it again?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff September 28, 2020 at 8:15 am

      Hi Shannon,

      If I understand correctly you want the users to be redirected to the restricted page if they’ve already submitted the form. If that is so, then setting the is_persistent parameter to true, should getting this working for you. Once the data are being stored in the cookie and the cookie hasn’t expired or been cleared, the users will not be required to complete the form again.

      Best,

  59. Pehn
    Pehn September 18, 2020 at 9:25 am

    Hello. I am at the part where I want to Add a New Custom Field but the options for gwsa_require_submission and gwsa_form_ids don’t appear. Am I missing something here?

    Reply
    1. Ryan Donovan
      Ryan Donovan September 18, 2020 at 9:53 am

      Hello Pehn, Thanks for writing in. You will need to add these fields as new custom fields within the custom fields screen option you activated earlier. Do you not see the custom fields options? Let us know and we can better assist. 😀

    2. Pehn
      Pehn September 18, 2020 at 10:44 am

      Hello Yes. I realized that now Thank You.

      I created a gravity form to a landing page. After the submission, the user will be redirected to a ‘thank you for submitting’ page.

      My next problem is that even though I made a submission to the form, it still doesn’t give me access to the page.

      I tried doing the redirect option but even though I do make a submission on the assigned ID of the form, it still redirects me to

      Does the form have to be on the same page?

    3. Ryan Donovan
      Ryan Donovan September 18, 2020 at 11:01 am

      Hello Pehn, Using the gwsa_form_ids hook will allow you to select which forms you can submit to gain access to the page. Add this custom field and set the value to the ID of the form which must be submitted to gain access to this page. If there are multiple forms that can be submitted to gain access, you may include them as a comma-delimited list (i.e. 1,2,3). If any form can be submitted to gain access to this page, do not add this custom field option. The redirect URL will take you away from the page if you do not have access to the page. So an example would be to set gwsa_form_ids to form 1. The user would have to submit form 1 before they can gain access to the form you have set this up for. Let us know if you have any other questions. 😀

    4. Pehn Sus
      Pehn Sus September 19, 2020 at 12:50 am

      yes I set gwsa_require_submission to 1 and I also used gwsa_form_ids with the exact id for the gravity form that I am using. in this case the form of my ID is 24 so i set gwsa_form_ids to 24.

      I am also using gwsa_requires_submission_redirect to redirect users to our custom 404 page when they have not made a submission.

      The problem is that even though I have made a submission to the gravity form, it still redirects me to the 404 page which is strange.

  60. Sebastian Kübler
    Sebastian Kübler August 28, 2020 at 11:25 am

    Hi,

    thanks for the plugin. So far it’s working great.

    We’re wondering if its possible to give the user the option to fill in form a or b to get acces to different page content? Is this or something similuar possible?

    Thanks in advance. Kind Regards, Sebastian

    Reply
    1. Ryan Donovan
      Ryan Donovan August 28, 2020 at 11:36 am

      Hello Sebastian, Just so we fully understand, you would like for the user to only be able to see a certain piece of content on the page or different pages altogether after filling in a form? Let us know a little more about your intent. 😃

    2. Sebastian Kübler
      Sebastian Kübler August 28, 2020 at 12:10 pm

      Hi Ryan,

      thanks for the reply,

      In best case we want the user to have the choice between two forms, which will generate a individual url paramenter. We can then query the parameter and display unique content on the page. That’s the plan.

      Hope this clearifys our plan :)

      Thanks so far, Sebastian

    3. Scott Ryer
      Scott Ryer Staff August 28, 2020 at 1:44 pm

      Hi Sebastian,

      This is a great fit for Post Content Merge Tags. When the restricted page is set as the Confirmation for the form, the Perk will automatically add a parameter. Merge tags can then be used in the Post content to display values from the form submission.

    4. Sebastian Kübler
      Sebastian Kübler August 31, 2020 at 3:16 am

      Hi Scrott,

      thanks for the reply.

      The question is if we can give the user the choice between two forms to submit and than gets shown specific content.

      In the desciption for the forms_id parameter is described that its possible to use multiple form id’s. Is this what im looking for because its currently not working. If I add twi Id’s it still only displays one form.

      Maybe this is an unusual request but it’s really nessesary for our customer that we can provide a solution like this.

      Bes Regards, Sebastian

    5. Samuel Bassah
      Samuel Bassah Staff September 7, 2020 at 10:38 am

      Hi Sebastian,

      Sorry, you may have missed the earlier reply on this, but Ryan sent you an email to check if you had a caching or optimizing plugin on your website because this is quite strange and you shouldn’t be experiencing this issue using the snippet. If you do have the caching or optimizing plugin, could you temporarily deactivate them and see if it works. Also, can you check the Gravity Forms settings (i.e. Forms > Settings) to confirm if you’re outputting CSS?

      That being said, you may also want to check with the Gravity Forms Support to see if they have any idea why this is happening.

      In case Gravity Forms Support says it’s something we’ll have to fix on our end, you can get back in touch via our support form and we’ll be happy to dig into this issue closely on your website.

      Best,

  61. Jamie
    Jamie August 1, 2020 at 11:22 pm

    Hi there, When i use this plugin, and I submit a form, it seems to show me the “Thank you for submitting…” message that is default in Gravity forms. But when i manually refresh the page, the gated content then appears. Am I doing something wrong here? I have tried with and without ajax as well.

    Cheers

    Reply
    1. Ryan Donovan
      Ryan Donovan August 2, 2020 at 7:20 pm

      Hello Jamie, this is a bit of a strange one. When you say you submit the form then refresh, and it displayed the gated content is that not the intent or are you trying to show a different form? Also are you trying to password lock the information or just require a submission before the content is shown? Are you using gwsa_requires_submission_redirect or is it just the same page? Let us know and we can help you out.

    2. Jamie
      Jamie August 2, 2020 at 9:30 pm

      Hi Ryan,

      Thanks for the reply, the content is on the same page, I have a button you click, which shows the forms, you fill this form out, and you get the thank you message. But you don’t see the content. Even if I remove the Ajax, and have the page refresh after a form submission, then I still only see the thank you message. I essentially have to then manually refresh the page again to then show the content. This isn’t going to be very good for user experience.

      https://www.thecolourcode.co.nz/resources/what-is-self-awareness-white-paper/

      So if you click the DOWNLOAD PDF button you can start the process and see how it’s functioning at the moment.

      The intent is that these PDF’s are then accessible once they submit the form on the same page. There will be lots of pages like this, with one form, so they will just stay on the page they are on once they submit the form.

      Hope that makes sense! Cheers

  62. Yogie
    Yogie July 28, 2020 at 11:28 am

    Hi David,

    I plan to limit several pages, but I want to use only one form.

    For example, there are pages A, B, C, D. I want when the user has filled out the form on page A, then he does not need to fill in pages B, C, and D again to open the content.

    Is it possible for me to set a custom redirect page on custom_field? Because this will greatly save the number of forms that I need to make, I just need to make 1 form instead of 4 forms.

    Thanks.

    Reply
    1. Ryan Donovan
      Ryan Donovan July 28, 2020 at 11:47 am

      Hello, any post-based content (that includes pages and custom post types) that support custom fields can be locked down. You set a few special custom fields and the Gravity Forms Submit to Access plugin takes care of the rest. To ensure I understand your question, do you want the redirect to just go to one page? You mentioned four forms reduced to one form so will this just be a form in multiple locations or? If you have a gravity perks license you can send us a form so we could take a look at your setup through our Support channel found here.

  63. Diego
    Diego June 29, 2020 at 2:22 am

    Hi there, Thank you for posting this plugin.

    I have a few questions: 1-Should the Gravity form be redirecting to itself, so it shows the gated content? If not, what’s the recommended settings in the form itself?

    2-I noticed that I made the page “private” as soon as I saved it the CF fields. As a result, users not logged in can’t access the page anymore (they get a 404. Not even able to see the form)

    3-Making the page public seems to have fixed the issue. Howeever, after submitting the form it won’t show the gated content at all. Have I missed anything?

    It’s hosted on Pantheon (with Redis caching). I’m using bypass_cache=true, gwsa_require_submission=1, is_persistent=true.

    Thank you so much.

    Reply
    1. Ryan Donovan
      Ryan Donovan June 29, 2020 at 10:34 am

      Hello Diego, 1) gwsa_requires_submission_redirect is a completely optional string, so this would be up to you if you want to use it.
      2) The main page will be locked and require a secondary form to gain access to the page. Add a custom field named gwsa_form_ids and set the value to the ID of whichever form the user should submit to gain access to this page. 3) You will need a way for users to access the page, so make sure the second form the user will submit to gain access to the page is set up correctly.

    2. Mark
      Mark July 29, 2024 at 8:42 am

      Hi,

      In Pantheon hosting, the cookie needs to be prefixed with STYXKEY_ in order to work through the cache correctly and be read by PHP (it does work with JS)

      m

  64. K Nichols
    K Nichols May 18, 2020 at 1:17 pm

    Hi Ryan: Thank you for the prompt response of my last request. I do have one other question. I am getting an error that my form page is not secure. Would this be due to me not employing a Captcha? If I use Captcha validation on the form (put the functionality on the form page), would this make the page secure? Or do I need to do something else? Thank you again. Kevin

    Reply
    1. Ryan Donovan
      Ryan Donovan May 18, 2020 at 1:51 pm

      Hello, That is a strange error. Could you link the page in question? Is this a pop up error or is this happening on the backend? Let us know.

    2. Ryan Donovan
      Ryan Donovan May 18, 2020 at 2:51 pm

      Hi, I do see that https://avenuecx.com/whitepaper/ is active but the link you sent is with HTTP access which is not secure. I think the main site is still configured to use the HTTP URL. Have you configured your site to only use HTTPS access? I would make sure your site is properly redirecting to HTTPS as that seems to be the issue.

  65. K Nichols
    K Nichols May 18, 2020 at 12:04 pm

    I am trying to use this functionality. Currently, I am developing the pages. Quick question: I noticed that if I have the actual link to the download (PDF) that I can access it regardless if I fill out the form or not. Is it possible to make it so that the user can’t put in the hard link to the PDF file and access the PDF? (I don’t want them sharing out the PDF) link on social, without filling out the form.) Kevin

    Reply
    1. Ryan Donovan
      Ryan Donovan May 18, 2020 at 12:36 pm

      Hello, Thanks for writing in. Sadly, we do not have a direct way of accomplishing this. If you wish to block a URL as well as block a file, you could use a membership plugin to completely limit who and what is seen by each user or you could use another plugin that specifically blocks only uploads.

  66. Adam
    Adam April 29, 2020 at 5:10 pm

    Wpengine support chat needs to do that, and they’re asking what to exclude.

    They are used to excluding pages. What do I tell them exactly?

    Reply
  67. Adam
    Adam April 29, 2020 at 4:45 pm

    I couldn’t get this to work. Maybe because I’m on Wp Engine?

    No matter what, after submission of form on page 1, followed by redirection to second page, shows the no access message.

    Reply
    1. Ryan Donovan
      Ryan Donovan April 29, 2020 at 4:52 pm

      Hey Adam, This may be caused by WP Engine cacheing the forms. Could you please exclude your forms from the cache and see if this resolves your issue? Thanks! 😃

  68. Ryan Donovan
    Ryan Donovan February 14, 2020 at 11:46 am

    Hello Andy,

    The “is_persistent” is a global parameter and needs to be set in the plugin file.

    new GW_Submit_Access( array( ‘is_persistent’ => false ) )

    Let us know if you have any other questions. :)

    Reply
  69. Dragan
    Dragan January 28, 2020 at 7:55 am

    Hello David,

    Nice tutorial, I want to ask if there is a way to set these values globally for specific Custom Post Type so there is no need to manually add all these fields on every new post.

    Thanks, Dragan

    Reply
  70. Andy Christian
    Andy Christian January 22, 2020 at 7:45 am

    Hi again, sorry for the spamming!

    Quick update on my previous question.

    On closer inspection of the cookie via Chrome inspect, the cookie remains set to persistent, even when I try to over-ride it via the custom fields.

    The only way i was able to make it session-based was to edit the plugin php file directly, by setting the default of “is_persistent” to false. This is fine, however I’m assuming this will just be overwritten again if I ever update the plugin.

    Would there be any reason why the custom fields wouldn’t be overwriting the default option?

    Reply
  71. Andy Christian
    Andy Christian January 22, 2020 at 6:11 am

    Hi there,

    For my set up I am looking for the user to enter their details every-time they access a page (once per session)

    I have set “is_persistent” to “true”, however when I close browser, and open page back up again, the form doesn’t show.

    It only resets when I manually clear my cookies.

    Any ideas?

    Reply
  72. Kemberle Griffin
    Kemberle Griffin January 16, 2020 at 12:17 pm

    I’d like to be able to put the form on one page and once it’s filled out take you to the page but still keep access limited to only users who fill out the form?

    Reply
  73. Jo
    Jo December 17, 2019 at 12:18 am

    Hi,

    Thank you so much for this useful article ! I was able to integrate it on my wesbite without any issue ;-).

    I noticed that after a first completion of the form, if the user clear his browser’s cache, he has to complete the form again to obtain the access to the protected page. Is it possible to make it permanent so that even if the user clear his browser’s cache, he still keep his access ?

    Thanks !

    Reply
    1. David Smith
      David Smith Staff December 17, 2019 at 9:43 am

      Hi Joe, if the user is logged-in this would be possible by enabling the “enable_user_meta” option.

    2. Joe
      Joe December 18, 2019 at 1:03 am

      Hello David,

      Thank you for your answer ;-) ! Yes, I already tried that but when the logged user clears his cache/cookies and then refresh the page (or login again), he still has to fill the form again… The custom fields I used are : gwsa_form_ids | gwsa_require_submission | gwsa_requires_submission_message| enable_user_meta. What did I miss, please ? Thanks for your help !

    3. David Smith
      David Smith Staff December 18, 2019 at 7:54 am

      Hi Joe, the “enable_user_meta” is a global parameter and needs to be set in the plugin file.

      new GW_Submit_Access( array( 'enable_user_meta' => true ) );

    4. Joe
      Joe December 18, 2019 at 9:27 am

      Thank you David (^_~) ! I didn’t know the global parameters need to be in the plugin file. However as i’m not a developer, I’m already lost. In which PHP file and where exactly I have to copy/paste your code, please ? Thanks again David !

    5. David Smith
      David Smith Staff December 18, 2019 at 12:18 pm

      We don’t have a great recommendation for editing plugin files other than via FTP. You can use the Plugin Editor in WordPress but you run the risk of making a typo and breaking your site. It’s much easier to undo mistakes like that when working via FTP.

    6. Joe
      Joe December 18, 2019 at 12:58 pm

      I understand. I’m so sorry for my bad english David, because I misformulated my question… Actually, please allow me to rephrase : Which *.php file from gravityforms plugin’s folder do I have to edit ? And in this php file, where do I have to insert your code, please ? Thank you ;-)

    7. David Smith
      David Smith Staff December 18, 2019 at 1:53 pm

      Hi Joe, it would be the plugin file you downloaded from our site here (not Gravity Forms itself). Look for gw-gravity-forms-submit-to-access in your /wp-content/plugins/ folder. Hope that helps. 🙂

    8. Joe
      Joe December 19, 2019 at 8:09 am

      Hi David, it’s done and working like a charm 🙂! I wanted to deeply thank you for your incredible help which allow me to make it work ! That was so important for my website and I’m really happy that your plugin could achieve exactly what I needed for my community. Big thank you David 🙂 !

  74. Domenico Cannetti
    Domenico Cannetti November 17, 2019 at 2:28 pm

    Hi, i have 2 form in 2 page:

    the first page “pay” with a credit card payment and the second page “mod” (hidden from the cookie) with another form

    if the user pay can access to second page

    now, after the second submission (page mod) how i can remove the cookie for return to lock the page and redirect to pay?

    tnx and sorry for my english

    Reply
    1. David Smith
      David Smith Staff December 17, 2019 at 11:47 am

      Hi Domenico, you would need to modify the value stored in the gwsa_submitted_forms cookie to remove the form ID that you would like to require to be resubmitted.

  75. Keenan Flogerzi
    Keenan Flogerzi October 30, 2019 at 2:54 pm

    Hi… I love how this is supposed to work and it seems half-way there.

    But as soon as I set the custom field “gwsa_require_submission” on a post, it breaks all jQuery on the page with a handful of console errors: Uncaught ReferenceError: jQuery is not defined

    I see a comment before where Sam said: “was also somehow dequeuing jquery.js and jquery-migrate.min.js from WordPress /wp-includes, so I had to re-queue those both in to the plugin code.”

    But I can’t seem to get those scripts queued again despite trying to add them in a few places on the init() function.

    Any ideas?

    Reply
    1. David Smith
      David Smith Staff November 4, 2019 at 7:24 pm

      Hi Keenan, I’m not able to recreate any issues with jQuery or jQuery migrate. If you check out the demo you can see that this working as expected on a basic WordPress installation. There isn’t much more we can offer pro bono; however, if you’re an Advanced or Pro Gravity Perks user, we’d be happy to dig into your specific configuration via support.

    2. Keenan Flogerzi
      Keenan Flogerzi November 4, 2019 at 9:35 pm

      Hey David, no worries! I was able to get a version of it working after playing with it. Not as full featured as the demo, but working for what I needed. Thanks for getting back!

  76. Rocky
    Rocky October 8, 2019 at 11:50 am

    We are using this for a client’s site and they cannot edit the page without filling out the form to sign up. Any word on allowing WordPress users with Administrator access to bypass the form?

    Reply
  77. Marc Avila
    Marc Avila September 25, 2019 at 12:23 pm

    Hello,

    I’ve set up this plugin according to your instructions above, but it doesn’t seem to quite work out the box. My content is in place in the default content editor (an embedded PDF) and I’ve set up the requirement to gate the content using your snippet, as well as the ID of the form the user needs to fill out to see the content. However, all I can see on my protected content page is my custom message of “You need to submit this form in order to view this content”. I expected a link or embed of the form in question to follow this message, and upon submitting that, the page will refresh to show the protected content. Is this not the case with the snippet? Is there anything else we need to consider to get this to work properly?

    I set up a link to a page with the embedded form in my Submission Message, but after submitting the form, I get redirected back fine to my protected content page, but instead of my content, I only see my form’s Confirmation message, along with the Submission Message still displayed at the top of the page.

    Reply
    1. David Smith
      David Smith Staff September 26, 2019 at 3:59 pm

      I would recommend including a link to the form in your custom message. Then setup the form to redirect back to that page.

  78. Ignacio
    Ignacio August 2, 2019 at 2:41 am

    Hello! I’m looking for a solution to force the users of the site to complete and update their User data and payment information. So my idea was to force them to complete a form based on User registration addon before they can continue to use the main page of the site. The question is, will this is snippet remember that the user has already completed that form and don’t appear again as a content blockage (still leave the form available in other page for future profile updates)? Should I combine it with Limit Submissions? Thanks!

    Reply
    1. David Smith
      David Smith Staff August 2, 2019 at 8:57 am

      Hi Ignacio, if you go into the plugin file you can add an “enable_user_meta” parameter to the global configuration that will track the submitted forms in the user meta rather than a cookie.

    1. David Smith
      David Smith Staff July 24, 2019 at 7:58 am

      Not clear on your first question and screenshot. Could you clarify?

      Yes, this uses cookies to track which forms the user has submitted.

    2. Shane Jackson
      Shane Jackson July 24, 2019 at 8:00 am

      That’s the content I would like displayed, which is the form confirmation message.

      Also, Can you say how to activate “Custom Fields” on pages?

    3. David Smith
      David Smith Staff July 24, 2019 at 11:46 am

      I still don’t understand. What flow are you trying to implement here?

      Pages should have custom field activated by default. If you’re not seeing them, try enabling them via the Screen Options tab at the top of the Page edit view.

  79. Sam
    Sam July 22, 2019 at 8:12 pm

    HI. It seems that when your plugin is in use to require a form to view page content, if a recaptcha exists on the form, it is unable to fire.

    If I load the Gravity Form on a blank page, the recaptcha shows up ok.

    If I load it via your plugin (gwsa_form_ids) the recaptcha scripts are not able to initialize, though they do appear to be on the page.

    Have you seen this behavior?

    Thanks

    Reply
    1. David Smith
      David Smith Staff July 23, 2019 at 8:02 am

      I haven’t specifically tested this scenario but it makes sense given that the form is loaded via an AJAX request. Historically, recaptcha has not worked in this scenario. We have plans to convert this simple snippet into a perk. I’ve added this as a feature to add support for when we do. ?

  80. Mega Media Factory
    Mega Media Factory July 9, 2019 at 3:38 pm

    Is there a way to go to a page with a form gravity form on the page (IE we want to make the page look nice with graphics, text, and the form).

    Then once the form is submitted on a page, then it will unlock content…

    Reply
    1. Mega Media Factory
      Mega Media Factory July 10, 2019 at 8:58 am

      Yes it does however, it only shows the gravity form itself on a plain page. I want to make the page visually appealing with photos, text, etc to entice a visitor to give up their name and email for the content. Is this possible?

    2. David Smith
      David Smith Staff July 10, 2019 at 9:02 am

      This is pretty bare bones snippet. It might be possible with some customization but out-of-the-box it just renders the form or directs the user to a page that contains the form that the user should submit.

    3. Mega Media Factory
      Mega Media Factory July 10, 2019 at 9:05 am

      The second part of your response is what i’m looking for it to do. Direct users to a page that contains the form to submit… Unless i’m missing something in the documentation, i’m looking for some direction on how to do this.. DM me if this needs to go private.

    4. David Smith
      David Smith Staff July 10, 2019 at 9:09 am

      The redirect is not automatic. Just add a link to your requires message to the page you want the user to go to get access. See the demo for an example.

  81. Kyle
    Kyle May 14, 2019 at 12:14 pm

    This plugin does not seem to work at all. I’ve got everything setup as shown in the example and even took things a bit further to bypass cache and tried using the redirect link as well as including the necessary form via shortcode in the gwsa_requires_submission_message field, but no matter what, the form submission doesn’t work.

    When the form is included in gwsa_requires_submission_message as a shortcode, the form disappears and content is shown but as soon as I refresh or attempt to access the page again from the nav, I have to again enter the form information.

    If I use the redirect to a stand-alone page where the form lives, then it never saves and I’m stuck in an endless redirect loop.

    WP 5.2 GF 2.4.9 FoundationPress custom theme

    Reply
    1. David Smith
      David Smith Staff May 15, 2019 at 10:49 am

      Try using {form} instead of the shortcode in the your gwsa_requires_submission_message field. This field was not originally intended to host a shortcode and there are some issues with doing so.

  82. Sam
    Sam April 16, 2019 at 6:19 pm

    Did anything ever become of the interest in gating ACF content with this plugin? Just wondering if there are some code samples out there to filter out specific ACF fields, then add them back in after the form is filed out.

    Ideally, I’d like to show all of the page content as it is normally, but replace an ACF field for “Download” or “View” with a “Register” button until the form is filled in. This way, the page can act as a teaser, and then after the form capture, can show the link to access the content.

    Reply
    1. David Smith
      David Smith Staff April 16, 2019 at 9:32 pm

      Hi Sam, we haven’t made much progress in that direction. If you’re outputting your ACF fields via PHP in a template, you could make use of the has_access( $post_id ) method to check if the user has fulfilled the requirements for the current post. If not, you could show your own custom conditional content.

    2. Sam
      Sam April 18, 2019 at 7:44 pm

      Thanks. This proved to be the easiest to implement.

      has_access( $post_id )) : //gate is open. Show stuff else: //gate is closed. Show form link endif; ?>

      The other odd thing I found is that the plugin wasn’t loading the default GF styles, and for some reason was also somehow dequeuing jquery.js and jquery-migrate.min.js from WordPress /wp-includes, so I had to re-queue those both in to the plugin code.

    3. David Smith
      David Smith Staff April 18, 2019 at 9:18 pm

      It depends on how you’re loading the form. We can’t wait to make this plugin easier to use. Glad you were able to get it working for your needs.

    1. David Smith
      David Smith Staff April 5, 2019 at 11:19 am

      Hi Teri, yup. All form submissions are tracked when this snippet is active. This is actually how the demo is configured.

  83. Gary Pyne
    Gary Pyne January 4, 2019 at 10:52 am

    Hi David,

    Can this be used to restrict access to a Woocommerce product page?

    Currently it just restricts access to description text.

    Cheers

    Reply
  84. Luzan
    Luzan November 20, 2018 at 6:48 am

    I am not sure if the problem is on my end or the plugin has stopped working. I am usiing Gravity Forms 2.1.3 and Gravity Forms Submit to Access version 1.7, I followed the instruction as above on my publicly published page, but still I am not seeing any message or anything.

    I can see the content of the page.

    Reply
  85. Ilya
    Ilya November 13, 2018 at 10:37 am

    Hi, I’ve just installed this plugin and now I can’t access the dashboard or even my login screen, all I get is this message – Authorization Required

    This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn’t understand how to supply the credentials required.

    Reply
    1. David Smith
      David Smith Staff November 13, 2018 at 10:41 am

      Hm, not sure. Log in with FTP, remove the plugin, and see if that issue goes away. No one else has reported this issue so it seems to be specific to your configuration.

    2. Ilya
      Ilya November 13, 2018 at 11:04 am

      Thanks! this worked. I first tried renaming it to just gw-gravity-forms-submit-to-access2 which I assumed would deactivate it at least but it was still not working. Deleting the folder worked though. Could it be clashing with a security plugin like ithemes? a real shame because I need a plugin that provides a download after a gravity form submission (including Stripe payment), I’ll try and find another solution.

  86. Faisal Yaqoob
    Faisal Yaqoob October 2, 2018 at 9:20 pm

    Hi, First of all. This is brilliant.

    Can we use this with ACF fields. I mean to say if a post has acf fields and can only access after form submission.

    Thanks

    Reply
    1. David Smith
      David Smith Staff October 2, 2018 at 10:28 pm

      It depends on how you have your ACF fields configured to be output. If they aren’t output within the_content, this probably won’t work out of the box.

  87. Will
    Will September 26, 2018 at 12:55 pm

    So I have tried implementing this and am getting the following problematic behavior:

    I have a page which I have included the requisite custom fields (gwsa_require_submission and gwsa_form_ids) when I go to this page I see the form appear.

    If I submit the form the page content loads.

    If I reload the page the form re-appears. If I open a new tab and navigate to this page the form appears, instead of the page content as I would expect.

    If I go to a secondary page with the same custom field values and the redirect field key/value it redirects instead of the content showing as I would expect.

    When I look at my developer tools I see that a cook (gwsa_submitted_forms) is set with value %5B1%5D.

    Do you (or anyone) have any clue why this is happening?

    Thanks, Will

    Reply
  88. Joe
    Joe September 11, 2018 at 3:50 am

    Hey Thanks!!! This is an awesome Plugin! I’m asking folks to vote for logo via Gravity Forms… then once they’ve voted I give them a chance to win a prize if they’ll just give us a little more info. I only wanted people who voted for a logo to be given the opportunity to enter the contest. “Submit a Gravity Form to Access Content” was the magic bullet! Much appreciated!

    Reply
  89. Rizwan
    Rizwan August 31, 2018 at 4:43 am

    Is it possible that i can make the cookie session very small. Once user submit the form and go to restricted page. With in 30 seconds the cookie session expired now if user refresh the restricted page then he again need to fill the form. Is that possible?

    Reply
    1. David Smith
      David Smith Staff August 31, 2018 at 7:28 am

      The easiest way to do this would be to replace line 309 of the snippet with this:

      $expiration = time() + 30;

  90. David
    David August 16, 2018 at 7:01 pm

    I’ve added the form to my single post template, but it seems if someone completes the form for any post, they can access all posts.

    Is it possible to collect this data for each post?

    Reply
    1. David Smith
      David Smith Staff August 24, 2018 at 10:06 am

      Hi David, this feature is not currently supported. The restriction is not dependent on which post the form is submitted from but which form is submitted. Definitely something we’ll consider for a future version.

  91. Scott Kirkowski
    Scott Kirkowski August 8, 2018 at 7:31 am

    I’m having a similar issue as David did, and try multiple ways to resolve this. The first way, we set the confirmation as a redirect to same page of the protected content. It just keep having the form reappear, only when we hit the submit form again (without entering any information), would the content appear. The second way, we set the confirmation as a redirect to a new page and had a link back to the protected content page. When they go back, the form still appears and not the content. It is using a child of the Divi theme. Is there something we are missing?

    Reply
    1. David Smith
      David Smith Staff August 24, 2018 at 10:11 am

      Hi Scott, hard to say. This snippet is difficult to debug remotely and, unfortunately, we don’t have the throughput to provide hands-on support pro bono; however, if you’re a Gravity Perks customer, we’ll be happy to provide additional support via the support form.

  92. Michael McHugh
    Michael McHugh July 25, 2018 at 12:11 am

    Is there by any chance a way to bypass the form while logged into the admin without disabling the requirement for site visitors?

    Mainly thinking about for general editing/previewing purposes. Even previewing from the admin send one to the form.

    Thanks, Michael

    Reply
    1. David Smith
      David Smith Staff July 25, 2018 at 8:30 am

      This is definitely something we’ll look into adding support for when we convert this snippet into a perk. For now, unfortunately, you’ll have to submit the form even as an admin. :/

  93. David
    David July 21, 2018 at 8:57 pm

    Every time I submit the form, the confirmation message of the form is shown instead of the protected content. Is there something I am missing?

    Reply
    1. David Smith
      David Smith Staff July 24, 2018 at 5:46 pm

      Can you share a screenshot of how you have the custom fields setup on your protected page?

    2. FreshySites
      FreshySites October 10, 2018 at 10:54 am

      Hi! Were you able to find a solution for this? Having the same issue currently. We submitted a support ticket with Gravity Wiz, but until then was curious if your fix could be applied to our site.

  94. Michael
    Michael June 21, 2018 at 8:33 pm

    It seems that in your example you have the form on a separate page from the content.

    How does one do that? Is that what happens when you use the ID, rather than the shortcode (which I used to have it sow the form description)?

    Having the form on a totally separate page would be better for styling that page, and having additional content below it perhaps, which is what I’m trying to do — show content below the form to further explain, entice them to fill it out, etc.

    How was that done?

    Reply
    1. Michael
      Michael June 21, 2018 at 8:46 pm

      Also, the demo form page says “This form automatically captured the url of the page you were just on and will redirect you back to that page when you submit the form.”

      What I’m trying to do is have a protected page linked to from a couple banners on various pages right to the form page, which they’d fill out and then be redirected to the protected page.

      Do you just put the link to a form on another page in the gwsa_requires_submission_message custom field?

      Thanks.

    2. Michael
      Michael June 21, 2018 at 9:25 pm

      I figured this out by doing what I asked above.

      Sorry, I was confused as I used the shortcode from the start, so the form was on the same page, not realizing it could be separate.

      You can deleted this thread, if you’d like. ;-)

    3. David Smith
      David Smith Staff June 21, 2018 at 9:53 pm

      Glad you got it sorted! I’ll leave it here (unless you want it removed). I think other people may benefit from seeing your train of thought. :)

    4. Michael
      Michael June 21, 2018 at 10:01 pm

      Sure. You can leave it. Might want to expound on the various ways it can be implemented in the actual post at some point, but if my stumbling through it helps someone else, great!

  95. Karl
    Karl June 1, 2018 at 6:10 am

    Hi David,

    Thank you for this tutorial, a very nice way to explain to novices like me.

    I have still an issue, I am stuck at the second step of Locking down the page. When I go on the screen options, the checkbox “Custom Fields” doesn’t exist.

    How could I resolve this problem please?

    Best regards.

    Reply
    1. David Smith
      David Smith Staff June 4, 2018 at 11:10 am

      Hi Karl, a plugin or your theme is probably hiding this option. Alternately, you might be using a custom post type that does not have custom field support.

  96. Michael
    Michael May 16, 2018 at 12:08 am

    Hi David,

    This was asked a while ago by Neal, but never responded to, and I am seeking the same behavior.

    Is there a way to use this to protect access not to the whole page, but to a part of a page.

    e.g. – there’s some teaser content, then to access the rest they have to fill in a form?

    Also, is there anyway to track access to page by form entries?

    Thanks, Michael

    Reply
    1. David Smith
      David Smith Staff May 16, 2018 at 7:53 am

      Hi Michael, this isn’t currently possible but it is something we’re interested in adding to this snippet in the future (probably via a Gutenburg block or shortcode).

  97. John Herman
    John Herman May 14, 2018 at 8:53 am

    Wanted to report a couple issues I had with this script.

    When I used the gwsa_requires_submission_message string it stops the form from appearing. (Tried it in different themes – had to skip using this feature.)

    I am having to put my page content in the GF Confirmation section as well as the content on the page. After completing the form it doesn’t show the homepage content on the confirmation content. What is everyone else using for this?

    Reply
    1. David Smith
      David Smith Staff May 14, 2018 at 10:16 am

      Hi John, if you use the requires submission message, you’ll need to include the form shortcode in the message: [gravityforms id="123"]. I’m not sure I understand your second issue? It should refresh the page after the form is submitted?

    1. BW
      BW April 11, 2018 at 3:56 pm

      Thanks David. I am using your plugin and you mentioned overriding the cookie expiration ($expiration) on line 309. I only have 290 lines in my file. Not sure where you’re referring to?

      Thanks.

    2. BW
      BW April 27, 2018 at 5:10 pm

      I apologize for the multiple comments. It is working but for some reason, not in all browsers and devices… Is there a cookie issue?

  98. Ezra Epstein
    Ezra Epstein March 22, 2018 at 4:47 am

    Two additional questions: 1) is there the inverse plugin : don’t show a page / content if a form has been filled in? 2) Instead of showing a message, is there the ability to redirect to a page on the condition of the form being filled in (or not being filled in) ?

    Reply
  99. Chris
    Chris March 12, 2018 at 11:43 am

    Hi David,

    I’m interested in using the plugin, would just like to clarify something. Asaf’s question in the list above is closest to what I’m looking to do, but I didn’t quite understand the outcome of that discussion.

    Is it possible to require form submission to enter a section of the website containing products, where the form completion landing page lists all of the products that only verified users can see? If so, what happens if they navigate directly to an internal link that is only linked to from the form completion page before they have verified?

    Also, is it possible to include an option on the form that rejects their attempt to verify? On the demo page both options take you to the hidden content (“Yes absolutely!” “I think so…”), could there be an option saying “no” for example which just closes the form and doesn’t allow access?

    Thanks, Chris

    Reply
    1. David Smith
      David Smith Staff April 11, 2018 at 12:03 pm

      Hi Chris, yes, you can lock down a whole section of the website but you would need to configure the functionality for each page in that section. This does not support a “no” option on the form. Submitting the form with any value selected will give access.

  100. Laurence
    Laurence February 7, 2018 at 2:22 pm

    Hello,

    I have implemented Gravity Forms Submit to Access on my site and am having a bit of trouble with my secured page showing my Divi theme data. I am receiving a bunch of shortcodes instead of the page builder styled columns & rows. I have set bypass cache to be true in the plugin php but this did not change the outcome of the page styling. Any help would be fantastic.

    • This is the page that contains the form which forwards the user to the Gravity Forms Submit to Access protected page:

    https://www.marathonfunrun.org/the-ride/

    *this is the page restricted by Gravity Forms Submit to Access:

    https://www.marathonfunrun.org/registration/

    Reply
  101. Laurence
    Laurence February 5, 2018 at 2:46 pm

    Hey David,

    I need a bit of help. Initially, my redirected page was only showing my requires submission message unless the user was logged in. Due to this fact, I enabled the bypass_cache in the php code. After doing this part of the page was displayed but I was receiving my Divi Page Builder code instead of having a standard styled page. Do i need to disable or allow the page builder?

    • After the registration form is submitted to the page below “REGISTER TODAY” the user is redirected to the protected page protected by Gravity Forms Submit.

    https://www.marathonfunrun.org/the-ride/

    Laurence

    Reply
  102. Christina
    Christina January 9, 2018 at 9:08 pm

    Hi David,

    A quick question – is there an option in this plugin to grant specific content access based on submitted form data?

    For example, Form 1 (the form in which one fills out to gain access) has a question where the answers are A, B or C – if the user answers A then upon submission, access to Form A is granted, if the user answers B then upon submission, access to Form B is granted and so on.

    Thank you, any response is appreciated.

    Reply
    1. David Smith
      David Smith Staff November 17, 2017 at 3:06 pm

      There is a special feature that allows you to do this by setting the “gwsa_require_submission” custom field to “global”. The user will be redirected to this post and required to submit the form before being able to access the site.

  103. Lee Ann O
    Lee Ann O October 11, 2017 at 9:36 am

    Hi, Your plugin is great and does exactly what I needed, but I have an issue with it occasionally sending people back to the form rather than the protected content. I just enabled the bypass_cache. Is there anything else I can do to prevent this from happening?

    Thank you!

    Reply
    1. David Smith
      David Smith Staff October 11, 2017 at 9:42 am

      Caching is the only known issue that would cause that. If you’ve enabled bypass_cache you should be good.

  104. Jean A
    Jean A October 3, 2017 at 10:03 am

    Weird. The plug only seems to work when I’m logged in as an admin. If I try the page via an incognito window or simply logout, I can never unlock the page by filling out the form. I can see the form ID in the cookie as expected but its like the plugin can’t access it. Any ideas?

    Reply
    1. David Smith
      David Smith Staff October 3, 2017 at 10:34 am

      Your host is probably caching the page for non-logged-in users. Check out the “bypass_cache” parameter. :)

  105. Lee Ann O
    Lee Ann O September 29, 2017 at 5:08 pm

    I need to block access to several pages and have a single form to get access. If I add the custom fields to each of the pages, using the same form ID, will people who complete form have access to all of the pages? Or, do you have to have multiple forms?

    Thank you!

    Reply
    1. David Smith
      David Smith Staff September 30, 2017 at 1:46 pm

      Hi Lee, they will only have to complete the form once. Any page that requires that form ID will now grant access to that user.

  106. Henrik
    Henrik August 24, 2017 at 4:19 pm

    Hi David,

    really great plugin – works fine. However, can I disable the cookie anyhow? I don’t want it to remember the submission, i.e. I would like the user to be forced to fill out the form each time he wants to access the page.

    Thanks,

    Henrik

    Reply
    1. David Smith
      David Smith Staff August 28, 2017 at 8:28 am

      More or less, yes. At the bottom of the code, there is this:

      new GW_Submit_Access();

      Update that to this:

      new GW_Submit_Access( array( 'is_persistent' => false ) );

      This will reset the cookie when the close their browser.

  107. Jean
    Jean August 4, 2017 at 1:55 pm

    Hi there,

    I am trying to require 2 different form to be submit to have access to the content. It works as intended if any of those form is submit. But what if i want to make them both require to be submitted to show the content? What i mean by this, is that the first form which has id 22, is the “first step” and that the second form with id 24, is the second step. Once the user has submit both form, now he could have access to the content of the page.

    Reply
    1. David Smith
      David Smith Staff August 12, 2017 at 6:19 pm

      Hi Jean, this is not currently supported. If you’d like to tackle this yourself, you would need to modify the logic in the “has_access” method. If you’re interested in hiring us to make this addition, hit me up at david at gravitywiz dot com. Include a link to this comment for context.

  108. David Brown
    David Brown August 1, 2017 at 11:50 am

    Hi,

    Seemed to be getting on well with the plugin but was having some trouble with the form still being displayed after submission so changed the bypass_cache setting to true. Now I am just seeing the tag on the page rather than the form eg [gravityform id="20" title="false" description="true"]. Any ideas where I’ve gone wrong?

    Reply
    1. David Brown
      David Brown August 14, 2017 at 7:15 am

      Thanks for responding. Wasn’t sure how to add an image, but the settings look like this,

      gwsa_form_ids 14,18,19,20,21,22

      gwsa_requires_submission_message

      White Papers

      [gravityform id="20" title="false" description="true"]

      gwsa_require_submission 1

    2. David Smith
      David Smith Staff August 14, 2017 at 8:00 am

      Replace the [gravityforms] shortcode in your “gwsa_requires_submission_message” to “{form}”. The script will handle the rest. It will use the first form in the “gwsa_form_ids” so if you want it to load form ID 20, set 20 as the first form ID in the comma-delimited list.

    3. David Brown
      David Brown August 14, 2017 at 8:51 am

      Thanks David.

      Updated the gwsa_requires_submission_message and now on the site it just says {form} where I would expect the form to be.

    4. David Brown
      David Brown August 14, 2017 at 11:20 am

      It’s set to true in the plugin PHP. Is this the right place to have set it? See code. I believe I have the 1.3 version of the code.

    5. David Brown
      David Brown August 16, 2017 at 6:27 am

      Many thanks. Everything working now except the CAPTCHA but that seems to be a general problem with our staging site rather than the plugin.

      Thanks again for the advice.

      D.

  109. Neal Ghoshal
    Neal Ghoshal July 17, 2017 at 11:26 pm

    Hi there – this looks really cool.

    Is there a way to use this to protect access not to the whole page, but to a part of a page.

    e.g. – there’s some teaser content, then to access the rest they have to fill in a form?

    Thanks for any reply.

    Neal

    Reply
  110. Rajesh Khatri
    Rajesh Khatri July 13, 2017 at 6:45 am

    I want this functionality with video, Video on page, before watching video gravity form will appear and after submitting form video will play on same page. My page has video shortcode and gravity form.

    How can i set both on same page, If i create separate page for one video i have to create that for all video posts?

    I want one gravity form for all video posts, that will capture user name and email address.

    Please give me suggestions, how can i use this>

    Thanks, Rajesh

    Reply
    1. David Smith
      David Smith Staff July 14, 2017 at 12:41 pm

      If you have a video on the page, you can configure your page to required access. Leave an empty require message and the Gravity Form will automatically be displayed if the user has not submitted it yet. You would need to enable the access requirement on each page for which you have a video.

    2. Rajesh Khatri
      Rajesh Khatri July 17, 2017 at 7:20 am

      When i set access for all videos page as below…

      gwsa_form_ids = 4 gwsa_requires_submission_message = [gravity form id=4] gwsa_require_submission = 1

      When user first time visit on one of video page, he get gravity form and after submitting for he is able to see video, afterthat when he visit another page he is now able to watch video instead of gravity form.

      I need to set all page with gravity form when he visit first time on the page. what i am doing wrong, please suggest.

      Thanks

    3. David Smith
      David Smith Staff July 17, 2017 at 11:23 am

      This only requires that the form be submitted once to have access to any page that requires this form. Only solution I can think of that would not required additional code is creating a separate form for each page.

    4. Rajesh Khatri
      Rajesh Khatri July 18, 2017 at 2:02 am

      Hello David,

      Please suggest better way to resolve from this issue, client is not technical, he could not able to create separate form for each video post.

      Thanks, Rajesh

  111. Dave Payne
    Dave Payne July 11, 2017 at 2:19 pm

    What if I want to send a select few people a unique code (some random number for instance), how could that work with this plugin to allow only those people access?

    Reply
    1. David Smith
      David Smith Staff July 14, 2017 at 12:46 pm

      You could combine this snippet with this snippet. This would allow you to require the user to enter a specific value in order to submit the form.

    1. David Smith
      David Smith Staff July 14, 2017 at 12:50 pm

      Easiest way is to leave the require message empty. The form will automatically be appended.

  112. Joke Wouters
    Joke Wouters July 5, 2017 at 10:22 am

    Hi,

    I noticed my comment did not get through so I’ll try again.

    First of all, amazing plugin! It’s exactly what I need unfortunately It’s not working on my page. I follow all your steps and the only thing that shows is the message.

    gwsa_require_submission => 1 gwsa_form_ids => 1 gwsa_requires_submission_message => my custom message

    I have gravity forms & gravity perks installed (both with valid license ofcourse).

    What am I doing wrong?

    Reply
    1. David Smith
      David Smith Staff July 5, 2017 at 10:53 am

      Hi Joke, trying adding {form} to your custom message to indicate where you would like the required form automatically appended. This was a feature just recently added and is not well documented.

      Just FYI, as a Gravity Perks user, you’re eligible for complimentary snippet support via the support form.

    2. Joke Wouters
      Joke Wouters July 5, 2017 at 11:09 am

      Hi David,

      Thanks. I used the support and am waiting for a response now.

      When I add {form} to the custom field gwsa_requires_submission_message, it just appears in text. Still no form…

  113. George Arabian
    George Arabian June 2, 2017 at 3:54 pm

    Great plugin!

    Everything works well except I’m having a bit of an issue when it comes to displaying the protected content after the form has been successfully submitted. My page is simply displaying the form’s confirmation message.

    Is there anyway that the protected content could be displayed instead of the form’s confirmation message?

    Here is my setup: gwsa_require_submission => 1 gwsa_form_ids => 1 gwsa_requires_submission_message => [gravityform id="7" title="false" description="true" ajax="true"]

    Reply
    1. George Arabian
      George Arabian June 2, 2017 at 3:55 pm

      Sorry, just noticed a typo in my comment. The shortcode id is actually set to id=”1″.

      Sorry about the typo, the question stills remains the same.

    2. David Smith
      David Smith Staff June 3, 2017 at 9:41 am

      Hi George, the easiest solution would be to configure your form’s confirmation as a redirect rather than a text confirmation. Then you can redirect to the page. You can use the page the form was submitted from in the redirect via the {embed_url} merge tag.

    1. Neil
      Neil April 25, 2017 at 9:42 am

      Hi David,

      Fantastic plugin, but I have one small issue, I use UX builder on the Flatsome theme, when I edit the post/page under the UX Builder, I just constantly get a spinner. Is this a known issue. Many thanks for a great piece of code.

      Regards, Neil

    2. David Smith
      David Smith Staff April 25, 2017 at 2:22 pm

      Hi Neil, I haven’t used this code with Flatsome but there are no known issues. Do you have a URL where I could recreate the issue?

    3. Neil
      Neil April 26, 2017 at 6:24 am

      Morning David, I can give you access to the development site if you like, with admin login, Also another question, I hope you don’t mind me asking. If the cookie is cleared from the browser does that mean that the person won’t have access to the pages? is there a way to make permanent and how do I reset this manually?

      KInd regards, Neil

    4. David Smith
      David Smith Staff April 26, 2017 at 6:54 am

      Hi Neil, a URL would be preferable. Logging in to your admin is above the level of support we typically provide for our free resources. We do provide complimentary support for our snippets for our Gravity Perks customers.

      If you’d like to make the cookie, you would have to require that the user logs in. Then it doesn’t use a cookie at all but stores the record in the user meta.

    5. Neil
      Neil April 26, 2017 at 7:08 am

      Hi David, Thank you so much for the quick reply, and I can understand the support as I haven’t purchased yet, but I promise I will this week as I need another one of your perks. I really appreciate your help and support on this, i’m not that concerned about the UX Builder not working at the moment, and the preferred route is using the logged in user meta, can I test this out? Do I need to change the snippet code?

      Many thanks Neil

    6. David Smith
      David Smith Staff April 26, 2017 at 7:19 am

      Hey Neil, we’d love to have you as a Gravity Perks customer. :)

      To enable user meta mode, you would have to edit the core plugin to enable it. Change this line at the bottom:

      new GW_Submit_Access();

      …to this:

      new GW_Submit_Access( array( ‘enable_user_meta’ => true ) );

    7. Neil
      Neil April 26, 2017 at 7:28 am

      Hi David,

      Many thanks, I will purchase your plugin the end of this week, I have just spent quite a bit on updating my gravityview and other plugins,so yours is the next inline to purchase.

      I will give this a go now, do I need to clear the cookies for this to work, also for testing can I add a true or false in the user_meta field in the database?

      Thanks again, Neil

    8. David Smith
      David Smith Staff April 26, 2017 at 7:29 am

      You do not need to clear the cookies. The user meta field would actually need to be empty or have an array of the form IDs that have been submitted by that user.

    9. Neil
      Neil April 26, 2017 at 8:45 am

      I’m so sorry David, not sure how this works, I have added the updated code as you have instructed to the core of the plugin and removed the old line of code.

      new GW_Submit_Access( array( ‘enable_user_meta’ => true ) );

      Do I need to add anything in the custom fields of each page? or do I change anything else for this to work. ie any of this code?

      ‘requires_submission_message’ => __( ‘Oops! You do not have access to this page.’ ), ‘bypass_cache’ => false, ‘loading_message’ => ”, // set later so we can use GFCommon to get URL to GF spinner, ‘enable_user_meta’ => true, ‘is_persistent’ => true,

      Sorry for the persistence but I think i’m nearly there. You mentioned this “You do not need to clear the cookies. The user meta field would actually need to be empty or have an array of the form IDs that have been submitted by that user” where do I add this user meta data?

      Thank you very much for your help, Neil

  114. chris
    chris March 29, 2017 at 11:29 am

    Your plugin works flawlessly on my staging server – migrated site to live and now completion of form throws the user back to square one. It is as if you had not filled out the form in the first place, and the cookie is not being set.

    Reply
  115. Asaf Epshtain
    Asaf Epshtain February 26, 2017 at 10:02 am

    Thanks for a simple plugin. I was wondering if I can use it to create a product launch sequence, where I have a landing page with GF, and some content pages. When a visitor submits the form, a cookie is set. When he tries to visit any of the content pages, there’ll be a cookie check if the form was submitted. If yes, show the page. If not, redirect visitor to the landing page

    Thanks

    Reply
    1. David Smith
      David Smith Staff February 27, 2017 at 7:42 am

      Hi Asaf, that’s pretty much what this plugin does. If you want to lock down the entire site until the user has submitted a form, you can use the global feature. Just set the “gwsa_require_submission” custom field value on whatever post you want the user to be redirected to if they haven’t submitted the form to “global”.

    2. Asaf Epshtain
      Asaf Epshtain February 28, 2017 at 10:15 am

      Thanks.

      I don’t understand how to set this custom field. In your post you say that “gwsa_require_submission” should be set to 1 (in the post / page I want to lock). How do I skip the defualt “gwsa_requires_submission_message” and just redirect to a specific post / page

  116. Eva
    Eva February 23, 2017 at 9:02 am

    Hi, Love the plugin, but I wondered if you can hide content that is not in the_content part of the page? Any pointers in the right direction are welcome! Thanks

    Reply
  117. Freshysites
    Freshysites February 3, 2017 at 10:33 am

    I followed the tutorial above, but it displays this message “Oops! You do not have access to this page.” with no link or gravity form. What am I doing wrong?

    Reply
    1. David Smith
      David Smith Staff February 3, 2017 at 10:29 pm

      Hey there, you’ll want to either include the form shortcode in your gwsa_requires_submission_message – or – you can include a link in the same message to the page where your form is located.

    1. David Smith
      David Smith Staff November 17, 2016 at 1:52 pm

      Hi Alessandro, I’ve confirmed that our demo is working (demo). This typically means there is an issue with your configuration. Unfortunately, we can’t support that but if you pick up a Gravity Perks license, we’ll be happy to help you via our support form.

  118. Min
    Min September 13, 2016 at 12:30 pm

    Hi, I want to tell you thank you for making this wonderful plugin! This is exactly what we need but is it possible to show some of the content before the submission message? We would want to show some teasers before the form.

    Thank you

    Reply
    1. David Smith
      David Smith Staff September 13, 2016 at 9:02 pm

      Glad you like it, Min. This isn’t currently possible without further customization. If you know how to extend a class, the easiest way would be to extend the GW_Submit_Access class and override the get_requires_submission_message() function with your own version. Your version could then fetch the post excerpt (or whatever teaser you want to show) and include that before the form. If you’d like to hire us to make this modification, get in touch.

  119. Ben
    Ben August 24, 2016 at 12:16 am

    Hello Thank you for excellent plugin But, is there a way to make it work with woo-commerce single product (not the product page) Thank you

    Reply
    1. Ben
      Ben August 24, 2016 at 11:15 am

      Hello I am using woocommerce in my wordpress site, I have some products that I want to restrict the access of them. How to do that?

    2. David Smith
      David Smith Staff August 24, 2016 at 5:52 pm

      This is not currently possible with the snippet. It uses “the_content” filter to hide the page’s contents. Since most of the WooCommerce page content is processed outside of this filter, it won’t be hidden if the product requires access.

      If you’d like to commission this functionality, get in touch.

  120. Concaten
    Concaten August 9, 2016 at 2:30 am

    Hi there I guess I forget a step. In your demo, you succeed in making a link to make appearing the form, and submitting the form reveal the content in ajax. Can you please told me the parameters I need to make things working like this ? coz in my case, with the same parameters, I just get the success message of the form, and I need to reload the page to access to the content. Thanks a lot !

    Reply
    1. David Smith
      David Smith Staff August 9, 2016 at 9:22 am

      Hi Concaten, just set the redirect of your form to the page that requires access. When they submit the form, they will be redirected to the page but this time they’ll be able to see the content.

    2. Aurélien
      Aurélien August 18, 2016 at 5:48 am

      Hi David, And thanks a lot for your answer and your explanation, it’s work for me ! Keep on the good job and thanks for your great plugin ! Cheers

  121. Elisa
    Elisa August 8, 2016 at 4:59 am

    Hi there,

    I’m not sure I get how this works. First, the form isn’t shown by default, which, I thought was the point? So I pasted the gf shortcode in the gwsa_requires_submission_message custom field, like suggested above. But then, I get the confirmation text displaying. I have to refresh the page to see content. What should I do?

    Many thanks,

    Elisa

    Reply
    1. David Smith
      David Smith Staff August 8, 2016 at 3:02 pm

      Hm, it is strange that you’re seeing the form’s confirmation when you add the shortcode to the custom field. Could you email me a WP login so I can take a closer look at your configuration? david at gravitywiz dot com

  122. Jean-Michel Batty
    Jean-Michel Batty June 16, 2016 at 1:50 pm

    Hello, I have an issue where the plugin would work as expected only if I’m logged in in my wordpress install. If I’m not logged in, I see the form and upon submission it loops back to the form.

    Any suggestions on where to start ? Many thanks for this awesome solution !

    Reply
    1. David Smith
      David Smith Staff June 30, 2016 at 9:08 am

      Hi Jean-Michel, I just confirmed the demo is working regardless of login status. This makes me think some sort of caching might be causing you grief. Try clearing your cache and also enabling the “bypass_cache” option (see article for details).

  123. Chris
    Chris April 26, 2016 at 10:09 am

    I have gone through every step. However, once my page is accessed, it simply throws an error stating that the user doesn’t have access to view the page. The form doesn’t show up though. Why doesn’t the form show up to allow them to access the content before throwing this message? My issue is that I created the link to the “protected content” on an image. Once they click it they should see the form and then gain access to the page – correct?

    Reply
    1. David Smith
      David Smith Staff April 26, 2016 at 10:25 am

      Not quite although this is probably how this snippet will be updated to function in the future. For now, you’ll need to include the [gravityforms id="123"] shortcode in your “gwsa_requires_submission_message” custom field if you want to display the form on the same page that requires access.

  124. Julian
    Julian February 5, 2016 at 4:53 pm

    Hi, 1.) is this configurable so that there is just an email address collection box displaying on page load? And they have to supply their email address to access the content? 2.) And is the content that is then displayed appearing from within Gravity forms? i.e. we would be limited to what is possible within gravity forms?

    Reply
    1. David Smith
      David Smith Staff March 8, 2016 at 10:57 pm

      Hi Julian, the email address collection box would be a Gravity Form. After they submit it the actual page content for whatever page (or post) this has been configured for would display. It would not be within a Gravity Form.

  125. My Wordpress Setup: Canvas, MailChimp, GravityForms and Other Tools - by Kendra Little January 6, 2016 at 1:29 pm

    […] free Gravity Forms Submit to Access plugin helps manage my download […]

    Reply
  126. Kendra
    Kendra January 6, 2016 at 12:57 pm

    Thank you so much! This is awesome. I found this really easy to install and configure. Just wanted to let you know that your work is appreciated.

    Reply
  127. Sarah DaSilva
    Sarah DaSilva January 4, 2016 at 4:32 pm

    My client would like users to only be able to access the hidden page once before the cookie expires, so that they can capture who is accessing each page (I know, I know). Is there a way to do this? I tried setting the cookie to expire immediately via time()-3600 but it meant that the hidden page couldn’t be accessed at all.

    Reply
  128. Colton Joseph
    Colton Joseph December 7, 2015 at 1:35 pm

    No form is showing on my page. ID is correctly set through custom fields – getting the loading content message and the customized message at the top of the screen “test test” – but no form loads.

    It’s not a plugin/theme conflict as I’ve switched to twenty-fifteen with all plugins disabled minus GF + this plugin – no change.

    Any ideas?

    Reply
    1. David Smith
      David Smith Staff December 14, 2015 at 8:33 am

      Hi Colton, this does not show the form automatically to users who do not yet have access. You can do this though by setting the gwsa_requires_submission_message custom field to a GF shortcode (example).

    1. David Smith
      David Smith Staff October 26, 2015 at 9:31 am

      Hi Rose, I’ve fixed the issue where the plugin download link was not working. In regards to LearnDash support, there is a good chance LearnDash pages are not being processed through the “the_content” WP filter, which this snippet relies on. If this is something you’d like to commission me to add support for, get in touch.

  129. Giacomo
    Giacomo October 21, 2015 at 9:53 am

    Hi David, it’s possible to use the wordpress role and not the coockie? I’d like to grant acces to a specific page to my registred users, but only if they submit a form. I’need that the access is forever for user after submitting a form. Also in a differente browser or device. It’s possible?

    Reply
    1. David Smith
      David Smith Staff October 21, 2015 at 11:05 am

      This is possible but it would require some changes to how the snippet functions. Instead of saving to the cookie, you could save the record of the submission to the user meta. This isn’t simple enough that I could give you step by step instructions. If you’d prefer to commission me to add support for this, feel free to get in touch.

  130. Melissa Meggiolaro
    Melissa Meggiolaro August 18, 2015 at 11:59 pm

    Have you ever experienced this not to work? For instance, I typed in the form ID of 15 and 1, and it’s returning the error message I typed in. I’m confused because this user has completed form 15, so does that mean that it has to be a new submission after this is added to the page – or can it look throughout the history. All help is greatly appreciated! http://www.realcareertalkcom

    Reply
    1. David Smith
      David Smith Staff August 20, 2015 at 8:59 am

      Hi Melissa, this solution doesn’t check if the user has ever submitted the form; it only checks if the user has recently submitted the form which is determined by a cookie this snippet adds to the user’s browser to track which forms have been submitted. The user would need to resubmit the form after this snippet had been installed to access the form again.

    2. Melissa Meggiolaro
      Melissa Meggiolaro August 21, 2015 at 8:14 am

      Thanks, Dave! So if the users clear their browser/cookie history, they would be asked to submit the form again, right? Do we know of any other way to accomplish this same goal – submit form 1 + submit form 2 (to post) = unlocking a page? I’m using the redirects after one form submission to send users to the next – but if they skip that form, they can currently go straight to a tool I only want unlocked after submitting the second form. All help is sincerely appreciated!

  131. Naomi Niles
    Naomi Niles May 28, 2015 at 3:35 pm

    This great. Thanks so much!

    Is there a way to do this to restrict pieces of content rather a whole page? I’d like to display a link to complete an assessment quiz for people who haven’t taken it already and then change that link into a buy now button if they pass the assessment.

    Thank you!!

    Reply
    1. David Smith
      David Smith Staff May 29, 2015 at 6:32 pm

      Hi Naomi, I’m glad you like it. Customizing this to limit pieces of content (probably via a shortcode) is possible but would require significant modification of the current snippet. I’d recommend hiring a developer to assist with this customization. WP Curve and Codeable.io are both great options for finding developers for small jobs like this.

  132. hannanstd
    hannanstd May 22, 2015 at 1:42 am

    Hi.

    please set this snippets by paypal standard payment status .

    i want to access content just if payment status is Paid or Active . thanks alot .

    i changed your snippet to my custom snippet by not work perfectly :

    http://pastebin.com/szPf60Ws

    thanks alooooooot .

    Reply
    1. David Smith
      David Smith Staff April 3, 2016 at 7:05 pm

      Hi Hannan, these changes were part of a project another user commissioned me to implement. I didn’t add any other improvements at this time. You can always extend the class so that your changes won’t get overwritten and you can still use the original class as a base and just overwrite the function you need for your change. :)

  133. @ommunist
    @ommunist March 4, 2015 at 2:12 am

    Cookie question. It seems the cookie is only saved per session in Firefox at least. Once I close FF, and go to that locked page, it shows form again. FF is set not to clean cookies upon shutdown.

    Reply
    1. David Smith
      David Smith Staff March 4, 2015 at 10:11 am

      First, wanted to say thanks for giving this such a thorough review. Not being sarcastic, I really appreciate it. :)

      You are correct, the cookie does expire with the session. You can set a more permanent cookie by setting the expiration date. Find this:

      setcookie( 'gwsa_submitted_forms', json_encode( $submitted_forms ), null, '/' );

      And replace with:

      setcookie( 'gwsa_submitted_forms', json_encode( $submitted_forms ), time()+3600, '/' );

      Note the time()+3600 bit. This is the expiration. It gets the current time and adds an hour (in seconds). You can increase this to any time period you’d like.

    2. @ommunist
      @ommunist March 5, 2015 at 3:18 am

      Thank you very much for explaining that to me. The case your solution solves is really widespread. One cryptic error remains. On WPEngine after I added bypass cache array to the bottom function, form returned literally 0 showing /wp-admin/admin-ajax.php instead of the page where it has to redirect for content.

    3. @ommunist
      @ommunist March 5, 2015 at 3:28 am

      Edge case. This is what I have. I realised, there is another form on every page, produced in GF. It is popup contact. May this be the issue?

  134. @ommunist
    @ommunist March 4, 2015 at 2:10 am

    It will not work if GF is configured to show text in Confirmation setting, only redirect to the same page will work. It will also not work on hosting with aggressive caching, like WP Engine. User will have to submit support request to hosting to exclude that page from cache. Otherwise it works.

    Reply
    1. David Smith
      David Smith Staff March 4, 2015 at 9:43 am

      Since you’re using the form in the required message, it still works with a text confirmation message, but the confirmation message is displayed (as expected) and not the protected content on the page. You would need to refresh the page to view the content.

      If you have the form on a separate page (check out the demo), you’ll see the flow is a little more natural with a text confirmation.

      Also, there is a special setting for aggressive caching. You can activate it by replacing…

      new GW_Submit_Access();

      …at the very bottom of the code, with:

      new GW_Submit_Access( array( 'bypass_cache' => true ) );

      This is used on the demo site which is powered by WP Engine.

  135. @ommunist
    @ommunist March 3, 2015 at 7:28 am

    Getting almost the same error, Farrel had. Warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in /nas/wp/www/staging/orcap/wp-content/plugins/gf-submit-to-access/gf-submit-to-access.php on line 155

    Reply
    1. @ommunist
      @ommunist March 3, 2015 at 7:39 am

      No, I am wrong, it is declared in gravityforms.php:3050 . Then why it does not return array?

    2. @ommunist
      @ommunist March 3, 2015 at 7:45 am

      Tried updated version. Now it only shows the message “Oops! You do not have access to this page.” instead of the form. No errors thrown, but no form (ID=8 in my case) too.

    3. David Smith
      David Smith Staff March 3, 2015 at 7:54 am

      It doesn’t show the form automatically. You can add the form by adding a custom field to the page with the key “gwsa_requires_submission_message” and the value can use a Gravity Forms shortcode to display the desired form if access is required.

      I have plans to show the desired from by default in a future version.

    4. @ommunist
      @ommunist March 3, 2015 at 8:01 am

      It works! I am braindead. 0. Set the form redirecting to the page which you’ll lock following the steps in the article. 1. Create page with the form. 2. Follow the steps in the article. 3. It works.

    5. Elisa
      Elisa August 8, 2016 at 5:18 am

      Hi, Found this entry after my inital comment.

      My case is : For every post, I need a form that’ll grant access to its content.

      I can use the same form every time, though I just can’t paste a link in the ‘redirect’ settings in gf, since it’ll be different every time.

      I would expect this to work as a password protected post actually.

      Is there a way to make this work?

      Elisa

  136. @ommunist
    @ommunist March 3, 2015 at 5:46 am

    Do I understand correctly, that a cookie is set to user browser upon submission, so if he returns to the same page, he will not be asked to fill the form one more time?

    Reply
  137. Jessy
    Jessy February 2, 2015 at 1:02 pm

    Hello, Thank you for this plugin! I was wondering one thing tho, how can I manually give access to certain users? Meaning, so that certain users that I chose can have access without submitting the form.

    Thank you!

    Reply
  138. Farrel
    Farrel February 2, 2015 at 1:11 am

    Thanks for posting this. I tried it as a plugin but I get this error message

    Warning: array_intersect(): Argument #2 is not an array in /wp-content/plugins/gravity-forms-submit-access/gravity-forms-submit-access.php on line 157

    Line 157: $matching_form_ids = array_intersect( $form_ids, $submitted_forms );

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Download Plugin

Submit a Gravity Form to Access Content

This field is for validation purposes and should be left unchanged.