This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to translate contact form 7 https://wordpress.org/plugins/bsk-contact-form-7-blacklist/
Solution:
The custom field in question is:

wpcf7_blacklist_options

By default, on our sandbox it was set to "don't translate". However, when I set it to "translate" and only updated the original contact form, these fields appeared in the translation editor.
Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/translating-custom-fields/

Tagged: 

This topic contains 15 replies, has 2 voices.

Last updated by Bruno Kos 3 months ago.

Assigned support staff: Bruno Kos.

Author Posts
July 17, 2019 at 7:15 am #4226511

geoffroyD-7

Hello,

I have recently translated all my contact forms using WPML. I have the "Blacklist" add on for contact forms 7.

The blacklists appear as well "translated" (I don't do anything but they duplicate automatically to other languages) but they seem to not work/work less well in translations.

To explain context: I used to have 3 seperate contact forms, 1 in each language of my website. I installed blacklist and it worked perfectly well. For example, it filtered all gmail adresses that tried to sign up.

I have now proceeded to translate all forms using WPML and the I now receive form submissions with email addresses that were previously blocked by the add on.

Any idea how this can happen or how I can solve this issue?

Josephine

July 17, 2019 at 8:39 am #4227559

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

I have now proceeded to translate all forms using WPML and the I now receive form submissions with email addresses that were previously blocked by the add on.

Does it mean that the list of the blocked emails is not working on translated forms? So in short, this would be a scenario:
- You translated contact forms
- you translated "blacklist" ( can you also tell me which plugin is this in fact)?
- however, when sending an email from translated pages/ forms, WPML does not take into account blacklist values - emails, it does not filter them properly, even though they are there, translated?

Regards,
Bruno Kos

July 17, 2019 at 8:48 am #4227817

geoffroyD-7

Hello,

Thank you for your answer. The scenario is not entirely exact:
1/ I translate the contact form (no translation is required of the blacklist, it is automatically duplicated on translations)
2/ when the form is filled in on a translated page the visitors can leave an email address that is forbidden by the blacklist.

The plugin I use is Contact Form 7 Blacklist: https://wordpress.org/plugins/bsk-contact-form-7-blacklist/

I hope this is clearer! 🙂
Josephine

July 17, 2019 at 9:54 am #4228399

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can you check this site? I have created clean sandbox installation where I configured WPML and installed all the plug-ins, including contact form and the blacklist. Can you assist bit more to have it all set up as on your site? I've also translated the form into French.

Login: hidden link
Username: demo
Password: 26ZtMaBj8l5M

However, I'm wondering about this:

(no translation is required of the blacklist, it is automatically duplicated on translations)

How do you know that this is happening? I am not able to find these blacklist values into any of the custom post types or custom fields.

In short, I'd like to ask you to complete our sandbox setup and provide me some information on how can I test this and reproduce? I will most likely send all of this to our compatibility team for further inspections.

On a side note, this plugin - https://wordpress.org/plugins/bsk-contact-form-7-blacklist/ - does not seem to be maintained (Last updated: 7 months ago) ? It only has 30 active installations and has not been tested with the latest WordPress versions.

Regards,
Bruno Kos

July 17, 2019 at 11:11 am #4229269

geoffroyD-7

Hello,

Thank you for your help.
I am working on the sandbox environment, I will let you know when it is done.

To answer your questions: I know the blacklist is applied to the translated forms because I can access the forms simply by changing the language when I am on a form to see the other versions.

I know that the plugin does not seem very good but i have found no other plugin that allowed me to do what I wanted to do (which means exclude domain names from submiting forms). If you have another plugin to suggest, I'd be happy to take a look at it.

Josephine

July 17, 2019 at 12:08 pm #4229803

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

OK, let me know how it goes. As for this:

If you have another plugin to suggest, I'd be happy to take a look at it.

I have no idea :(. I also googled around to find potential solution, but I do not see any relevant result. It seems like that this is the only one, but even their Pro version hasn't been updated for a while (hidden link). I am hoping that this is only because there were no new features or updates required, not even for the latest WordPress versions.

Regards,
Bruno Kos

July 17, 2019 at 12:09 pm #4229805

geoffroyD-7

I'm so sorry for this, but I didn't provide you with the right plugin!
I have been using this one: hidden link

I installed it on the sandbox to configure it. You can see that even if you don't need to translate the blacklist, it gets duplicated into the FR version.

I added the form on the sample page. On the english version of the page, an email addres ending in gmail.com is rejected, whereas it is accepted on the franch version of the page.

Josephine

July 17, 2019 at 12:10 pm #4229807

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I know the blacklist is applied to the translated forms because I can access the forms simply by changing the language when I am on a form to see the other versions.

I forgot about this one - this is not necessarily true. When switching language in the dashboard, something will always show up, however it does not necessarily mean that it is used by that other form and on another language.

Regards,
Bruno Kos

July 17, 2019 at 12:11 pm #4229815

geoffroyD-7

Ok, than the issue is quite obvious to me: the blacklist part of the form does not get translated! Any Idea how to solve this?

July 17, 2019 at 12:27 pm #4229965

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Then the other thingThat other plugin does allow us some things - one of them being able to translate custom fields, because it registered them. The custom field in question is:

wpcf7_blacklist_options

By default, on our sandbox it was set to "don't translate". However, when I set it to "translate" and only updated the original contact form, these fields appeared in the translation editor.

Since these will synchronize between languages, we do not need to translate them, so can you try putting "copy" on your website (WPML -> settings -> Custom fields translation) , open the contact form in original language, click update so that the translation picks it up and try then?

Does it work?

Regards,
Bruno Kos

July 17, 2019 at 12:55 pm #4230159

geoffroyD-7

Hello,

So this might indeed be the problem. I set all the settings to copy as they will remain the same on both languages.
The problem is that this is not changed on the forms that have already been translated.

Even when I change the settings to "translate", all the forms that have already been translated don't show the field for the blacklist.

Any idea on how to make that setting apply to all "old" translations?

Josephine

July 17, 2019 at 1:12 pm #4230379

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I set all the settings to copy as they will remain the same on both languages.

Now open the contact form in original language and click "Save". WPML should do the rest - copy these values into the translated form. It should work on all the forms that hold these values through that custom field, so for old and new.

Even when I change the settings to "translate", all the forms that have already been translated don't show the field for the blacklist.

Did you click "Save" on the original form? If you open WPML -> translations, a "Waiting for translator - (needs update)" would indicate that the form has some new values to be updated.

Regards,
Bruno Kos

July 17, 2019 at 1:21 pm #4230493

geoffroyD-7

Ok, so I needed to make a change and for some forms, specifically in the blacklist section to be able to translate them again.

Even after doing all of the updates, not all of the forms were working as expected. Some do now, so I don't know to what that can be due.

July 17, 2019 at 1:47 pm #4230795

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Ok, so I needed to make a change and for some forms, specifically in the blacklist section to be able to translate them again.

I do not think you need to make any change in the blacklist section, because we want to copy these values. Simply click "Save" on the form - you could change something trivial such as one letter, but that should not be needed usually.

not all of the forms were working as expected.

Do you mean that the blacklist functionality now works on some form translations, but it doesn't work on others? Can you try creating a new form and test the blacklist there? If these non-working forms are not complex (you could copy-paste the content), did you consider re-creating them new (in case it works for new forms)?

Regards,
Bruno Kos

July 17, 2019 at 3:03 pm #4231513

geoffroyD-7

Hmm, simply clicking save or changing one letter did not allow me to translate all the forms again. But by changing something, it did work.

Yes, when I set the setting to "copy", it worked only for some forms, not all.

However, I have now changed the setting to "translate" and I need to "translate" every line I give into the blacklist. Once that is done, it seems to work all fine.

So problem solved! 🙂