Ever wished you could limit form submissions so that a single user could submit only once? Run a contest with one-off coupons or prize codes? Offer discounts that can be redeemed by a customer only once? We know many of you do, as these scenarios and others like them have been some of the most popular feature requests we’ve gotten for Ninja Forms. Now you can!
Version 3.1.8 of Ninja Forms introduces the Unique Field setting to your WordPress websites. This field makes it possible to limit user submissions quickly and easily with a single setting. Keep reading and we’ll show you how it’s done and how it works!
The Unique Field Setting
This is going to be a really short introduction; this is so very simple there just doesn’t look to be that much to it. All the hard work happens behind the scenes! If you’re updated to version 3.1.8:
- Open any form and click on the Advanced tab at the top of the builder
- Choose Restrictions from the options you see there
- See the Unique Field Setting at the top of the Restrictions settings window!
Told you it’d be a really short introduction! While it doesn’t look that complex, what’s happening underneath the Ninja Forms UI is actually super complicated. At this time, you’ll only be able to set one field as unique for exactly that reason. We’re going to build on this so that you can eventually have more than one, however. Let’s look at how to use this thing now!
Using the Unique Field to Limit Form Submissions by User or Field
Again, from the UI this is a super simple setting to use. I’ve selected one of the basic Contact Me templates in my form builder and navigated to the Unique Field setting. Let’s say I want to accept a submission only once based on a user’s email address. I simply select the Email field from the Unique Field dropdown and (optional) configure the error message as desired:
That’s all there is to it! Now when a user attempts to submit this form using an email address that has previously been entered, they’ll receive the error message you’ve entered and the form will not submit.
Note that there are many other options in the dropdown:
Any of these fields can be selected and tagged as unique, allowing you to do much more than limit form submissions based on email alone.
What are some of the other things you could do with this feature? One-time-use coupon codes spring immediately to mind, as does restricting a user to claiming a discount only once. How are you going to be using it? We (and our other readers) would love to hear fresh ideas. Let us know in the comments!
peter says:
Would be nice to restrict by number of registered users… like 25 for an small event with limited space
Quay Morgan says:
Peter,
Hey! Thanks much for the feedback. We’ll be expanding on this feature as we’re able to devote development time to it. I’ll make a note of your request!
Cheers,
Quay
Mimi says:
I just want to second Peter’s suggestion. I’m looking at using a Ninja Form for event registration and was trying to figure out how to limit the number of people that can register.
Frank says:
it would be wonderful, if ninja forms could help me to limit the amount of visitors for an event.
thx!!!
Gaby says:
I second this motion!
Gaby
Denny says:
I’m really looking forward to choose multiple unique fields.
Brandon says:
This update is a relief but could be better.
I would really like to limit unique fields by email AND Phone Number. I have people making multiple submissions with fake emails with the same phone number in my giveaways.
Quay Morgan says:
Brandon,
Agree. It could be better. Our dev team has plans to expand on this is in the future. Sorry it’s not fully capable of this right now.
Cheers,
Quay
Kyle Braun says:
Any chance theres a way to limit the # of submissions per day and then allow the same number for the same user for the next day?
Quay Morgan says:
Hey Kyle- there’s not a way to limit submissions to x per day right now. I can definitely take it to our dev team as a feature request, though. Thanks for the feedback and sorry we can’t meet this need right now :/
Cheers,
Quay
Brian Gath says:
I’d like this too!
Tim Freeman says:
It would be nice to limit based on hidden fields. For example, a logged in user submits a form in which UID is being passed through as a hidden field. If this same user tries to submit again, it would recognize that a duplicate hidden field is trying to be passed and instead display an error message.
AB says:
I second this- I was hoping to do something like generating a combination hidden field of “wordpress user + day” that would limit entries to 1 per day and it doesn’t seem to allow hidden fields.
Mert says:
Hey Tim, I needed the same functionality and I think I’ve found a way to solve it. You can simply add a text field, preferrably single line and set the default value as username, and disable edits on that field. Since it’s a seen field, you can put a unique input restriction on that username and you will have the same functionality. If you don’t want it to be seen, some CSS code would do that for you 🙂 Hope it solves your problem as it did for me.
Chris says:
Hi Quay,
This is very helpful, but do you have a timeline on when you might be implementing multiple unique fields? I’d like do do email address plus a specific hardware related string to prevent users continuously re-registering some software.
Quay Morgan says:
I really wish I had a better answer here, but not for the foreseeable future. It’s something that we plan on doing, and does exist in our product backlog to be done, but it honestly may take a while for our devs to get to it around other priorities right now. I’m sorry.
Cheers,
Quay
Dave Gill says:
Hi… my question is whether there is a way to limit submissions by email address across all forms on a single website?
I have 9 forms on our site and people often fill out all of them, not for nefarious reasons but because they think that’s the only way to contact all partners. But actually each form goes to all partners so we end up getting lots of duplicate entries.
Or does this in fact work that way – across all forms on a domain?
Quay Morgan says:
Not right now, I’m sorry. We’re looking to expand on this feature in the future, hopefully sooner rather than later as we’re getting a lot of requests for it to do more 🙂
David Wheeler says:
Another vote for multiple unique fields please.
This functionality is quite limited unless you can combine unique fields.
Christine says:
Is it possible to clear the restrictions?
Curtis Brownlee says:
Hi,
You can clear the “Unique Field” restriction by changing the dropdown for the unique field back to the top, blank option. This will unset the restriction.
For a the numerical “Submission Limit” setting, increasing the number or deleting the number will remove the restriction.
I hope that this helps to guide you in the right direction.
Best regard,
Curtis
WP Ninja
Kristy says:
Hi! Is it possible to receive an email notification when a form’s submission limit has been reached?
Curtis Brownlee says:
Hi,
A feature to send an email to an address when a form reaches its limit is something that is on our roadmap, but unfortunately this has not been added as a feature yet. I sincerely apologize.
Best regards,
Curtis
WP Ninja
Alex says:
Is there a way to hide the submit button if a user has already reached the limited number of submissions? This would help with any confusion.
From a user point of view it would be frustrating to fill in a form try to submit it, only to find you have reached your limit
Curtis Brownlee says:
Hi,
If you set a Submission Limit to your form, you can specify a “Limit Reached Message” that will display when visitors try to view your form after that numerical submission limit has been reached.
When limiting a form via a Unique Field, however, this check is only performed when the form is submitted. Custom code would be necessary in order to perform this check prior to form submission.
I hope that this helps to clarify.
Best regards,
Curtis
Jason says:
Have you made it so that users can set restrictions on IP, telephone and email? If any of those has been previously submitted, the form will not submit…?
Quay Morgan says:
Yep!
Diaa says:
It will be awesome for coupon system that coupon has validation date
Michael says:
Hi, I also second more functionality for unique fields.
One improvement that would be great is if, instead of just getting an error message when submitting a form with a field that has been taken, that the label of the taken field could change to show users that the field is taken. For example, if a user can choose from several dates from a select dropdown, instead of having to try to submit the form to find out that the date was taken, the label would change when loading the form (to something like “Taken”). For fields with many choices that are taken, some of my users seem to get frustrated and I have had to manually change the label in the dashboard to make it easier for them to know that an option is taken.
Kaz says:
Hi all – trying to limit submissions per day (and ideally based on a list of choices in a dropdown). I see that Gravity Form allows for time based restrictions… http://gravitywiz.com/better-limit-submission-per-time-period-by-user-or-ip/ Dang, had I known I would’ve invested in that!
But I like NinjaForms overall and I am hoping that seeing this article NinjaForms would come out with a way to add that type of much needed functionality!
thanks!
Katherine Rojas Alfaro says:
Let’s say I have a select field to choose from Room A and Room B.
I need to restrict submissions by room, so each room has x number of submissions.
Is that possible without making a form for each room?
Tor Ivan Boine says:
This is the easiest form I have found. But like with all forms, there is a key feature missing.
We run a makerspace and we have to limit the attendees to 10 people under 15yo and 5 people over 15yo.
for example, how do I limit submissions for 15yo independently?
Quay Morgan says:
Not possible yet, but this is popularly requested so it’s only a matter of time before it’s added. Sorry!
Ruben says:
Hi,
Is it already possible to restrict by number of registered users? Like 25 for a small event?
@Quay Morgan
On January 30, 2018 you said you’d make a note of this request.
Is this feature already added?
Kathy Zant says:
Hi Ruben, one option for this implementation would be to limit the number of submissions a form can accept. There is an option for Limit Submissions under restrictions. https://ninjaforms.com/docs/form-settings/
Bex Charteris says:
I second the above comments about multiple unique fields!
When creating forms for events on certain dates, or number of seats in a van, or different age limits it would be so helpful not to have to create a separate form for each category. I want to have a restriction that says when X amount of submissions on date 1 is reached then mark as full/limit restriction reached; or when 10 submissions for van 1 is taken mark as full/limit restriction reached; or when we have x children under 18 years old reached display as no more children’s tickets available/limit restriction reached.
Chad says:
I have a client that wants to not allow for submissions if the date chosen is less than 24 hours in advance, for example they would not be able to choose today as their start date in the form. Is this possible with Restrictions? Thank you.
Shaylee Hansen says:
Hello Chad,
If you would please reach out to our customer support team so that we can further assist you: https://ninjaforms.com/contact. Otherwise, I recommend taking a look at our Advanced Datepicker add-on documentation here.
Nikki Giron says:
Are you able to do it where you set it for a certain amount of time then it ‘resets’? For example, we have a form to vote every week and I want to restrict people from voting more than once per week?
Shaylee Hansen says:
Hello Nikki,
Limit submissions by Date/Time with our Advanced Datepicker add-on. For more information please reach out to our customer support team so that we can further assist you: https://ninjaforms.com/contact.