4 Steps to Create Survey Forms in WordPress that Only Certain People Can Access
Tags: wordpress
Published: 2021-02-02 03:37:22

<!-- wp:paragraph -->

<p>Want to create a survey, poll, etc. on your WordPress site? Easy peasy! But how can you allow <strong>only certain people</strong> to access these survey forms, and then<strong> hide or remove them after a few days</strong>? Sounds difficult, right? But don't worry, we are right here to help you!</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>First, you just need to <strong>create a survey form</strong> and then allow the reader to<strong> create an account</strong> to log in to your WordPress website. Afterward, use a <strong>user roles management plugin</strong> to limit who can access the survey form. Finally, <strong>create an expiration date</strong> for the survey / poll. Everything can be done within 4 steps below:</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Step 1: Create a Survey Form on Your WordPress Website</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>There are many ways to create survey forms in WordPress such as using plugins, using <a href="https://metabox.io/series/custom-fields">custom fields</a>, coding manually, using <a href="https://metabox.io/best-wordpress-page-builders/">page builders</a>, etc.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>In this article, I use the Gravity Form plugin (premium only). Although there are many free <a href="https://metabox.io/best-wordpress-contact-form-plugins/">contact form plugins</a> used to create survey forms, polls, etc., I choose this premium plugin because it has many advanced customization options and settings. These advanced settings will be useful in the future when you need more than a simple form.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>First, purchase Gravity Form, and then go to <strong>Dashboard </strong>&gt; <strong>Add New </strong>&gt; <strong>Upload </strong>to <a href="https://gretathemes.com/install-wordpress-plugin/" rel="follow">install and activate the plugin</a>.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Once activating, go to <strong>Forms </strong>&gt; <strong>Add New</strong>.</p>

<p><img class="aligncenter" src="https://i.imgur.com/JziGZDq.png" alt="Install and activate the Gravity Form to create survey forms in WordPress" width="717" height="552" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>This is the interface to create forms of Gravity Form plugin:</p>

<p><img class="aligncenter" src="https://i.imgur.com/6mXR98Z.png" alt="The interface to create forms of Gravity Form plugin" width="1004" height="904" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>After you finished creating the survey form, insert it to any post / page you want.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>If you're using <a href="https://deluxeblogtips.com/beginners-guide-wordpress-gutenberg-editor/" rel="follow">Gutenberg editor</a>, look for the Gravity Forms block and choose the desired form:</p>

<p><img class="aligncenter" src="https://i.imgur.com/fIoosDQ.png" alt="Insert the survey form into the page with the Gutenberg editor" width="934" height="777" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>If you're using Classic Editor, you will see the button to insert forms like this:</p>

<p><img class="aligncenter" src="https://i.imgur.com/gyDBfLS.png" alt="Insert the survey forms with the Classic Editor" width="853" height="570" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>Simpler, you can use the following shortcode to display the survey form wherever you want:</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<pre>[gravityform id="1" title="false" ajax="true" tabindex="49"]</pre>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p><strong>Note</strong>: <code>id="1"</code> is the ID of the survey form that you've created.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Step 2: Choose Who Can Access the Survey Form</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>I'm going to use <strong>Member</strong> plugin to control who can see and fill in the survey form that we've created in step 1. This is a free plugin that allows you to quickly manage, add user roles and permissions in WordPress.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Upon activation, go to <strong>Members </strong>&gt; <strong>Add New Role</strong>. You can grant certain permissions to this user role. However, if you just want to allow them to see and interact with the form, you better choose only the "<strong>Read</strong>" option in the <strong>General </strong>section.</p>

<p><img class="aligncenter" src="https://i.imgur.com/WWZcnem.png" alt="Add a new user role that is allowed to access the survey form with Member plugin" width="1632" height="907" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>Once finishing, go to the survey page, edit it, and drag to the bottom. Here you can choose the user role that is allowed to access and take part in the survey (in this article, it's Form User).</p>

<p><img class="aligncenter" src="https://i.imgur.com/2jQVoSG.png" alt="Allow certain people to see and fill in the survey form" width="1920" height="969" /></p>

<!-- /wp:embed -->

<!-- wp:paragraph -->

<p>Done! You've finished allowing only Form Users to see and respond to the survey.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Step 3: Allow Users to Create Their Accounts</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>In this step, we are going to allow users to create their accounts on the front end. Once they have their accounts, they will be granted the "Form User" role.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>To do that, you need core <a href="https://metabox.io/">Meta Box</a> plugin (create custom fields) and <a href="https://metabox.io/plugins/mb-favorite-posts/">MB User Profile</a> extension (create registration and login forms, manage accounts on the front end).</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>We have an article on how to create an account page on the front end, you can refer to it <a href="https://metabox.io/p1-add-guest-author-in-wordpress/#create-my-account-page-in-the-frontend">here</a>.</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>Once finishing, I went to the front end and took a test. As you can see, when I hadn't logged in yet, I couldn't view the survey. But when I logged in with the account registered as a Form User, I could already see and fill in the survey form.</p>

<p><img class="aligncenter" src="https://i.imgur.com/qaTgRFT.gif" alt="Users Create Their Accounts and access the survey form" width="1920" height="1040" /></p>

<!-- /wp:embed -->

<!-- wp:heading -->

<h2>Step 4: Automatically Hide / Remove the Survey Forms</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>Normally, we just do the survey in a certain term of time. If you want to hide or remove the survey form when the survey ends, you can use Post Expirator plugin (free).</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>To get more details, refer to this article.</p>

<!-- /wp:paragraph -->

<!-- wp:heading -->

<h2>Last Words</h2>

<!-- /wp:heading -->

<!-- wp:paragraph -->

<p>This is an easy and straightforward method to create survey forms to collect user feedback and allow certain people to see and participate in the survey. Moreover, you can also automatically hide the survey after it ends. Very convenient, right?</p>

<!-- /wp:paragraph -->

<!-- wp:paragraph -->

<p>If you're getting stuck with troubles related to meta boxes and custom fields, feel free to share them with us in the comment section or in the <a href="https://www.facebook.com/groups/metaboxusers">Meta Box users group</a>.</p>