Welcome to Web Hosting Forum - Net Hosting Talk

Register now and be part of our community! When you register with the Net Hosting Talk you can join in with topics, start new topics, and generally be a part of the first level of our community. It's also quick and totally free, so what are you waiting for?

Contact form 7 amazing tweaks and tricks

edwin

Moderator
Messages
40
Reaction score
3
Hi all,

When you edit a Contact Form 7 form, you usually configure the fields that the form will carry and little else. Many users do not even check the settings of the emails that are sent with the form. What almost no one takes advantage of is the additional settings tab.

It only has an empty text area field, with the sole indication of a link to the plugin author's website. This text area is used to include code snippets in the format accepted by the plugin, but which ones? It is understood that many people are not encouraged to use it, it can even be intimidating, but we will solve that right now.

Subscriber-only mode

If you want a form to be sent only by users connected to your site, you can use this mode. If you add the following code, only registered users who are connected to your website will be able to send the contact form.

To activate it add the following:
You don't have permission to view the spoiler content. Log in or register now.

If the user is not registered, they will see a message that it is mandatory to log in to their account, and if they are registered they will see it like any other form. In this mode, there is no anti-spam check, as it is assumed that only registered users can use it.

Demo mode

If you activate the demo mode, the sent form message will be displayed but the emails of the same are not sent. It is just to check if the form works. Even if you have the Flamingo plugin active, the forms will not be stored, it is only for testing.

To activate it add the following:
You don't have permission to view the spoiler content. Log in or register now.

Skip email

If you want the form to be stored normally in the Flamingo database but not to send any email then the way to skip email is appropriate. It is its only difference from the demo mode.

It is activated with this code:
You don't have permission to view the spoiler content. Log in or register now.

Acceptance as validation

By default, an accept box behaves differently from other types of fields. For example, it does not display validation error messages even though the box is not checked.
If you add the code to activate acceptance as validation, this field will behave like the rest of the form fields, showing validation errors if the box is not checked. In my opinion, this additional adjustment code should be added whenever your forms have an acceptance box.

The code to add is this:
You don't have permission to view the spoiler content. Log in or register now.

The most noticeable difference is that without this code the form cannot be sent, a forbidden icon appears when trying to do so, if you do not activate the acceptance box, something that complies, but does not explain anything, the user does not know why lets you send it.

However, with the acceptance as validation activated, you can try to send the form normally, but you will get an error and the indication of what you are missing, in this case, the validation box.

Flamingo additional settings

If you use the Flamingo plugin, the Contact Form 7 form management plugin, then you have some special additional settings.

Do not store

This additional setting not only works for Flamingo but also applies to any plugin that stores Contact Form 7 forms. It simply serves so that the submissions of the form in question are not stored.

The code to add is this:
You don't have permission to view the spoiler content. Log in or register now.

Once added the emails will be sent normally, but the submissions will not be shown in the Flamingo form management or another plugin.

Now you know to manage Contact Form 7 additional settings and use code snippets as well as ordinary customization.

Thank you for reading :)
 

Advertisement

Top