Tagged: CONTACT FORM, html, links, spam
-
AuthorPosts
-
February 16, 2022 at 10:08 am #1340878
Hi,
how can I stop the setting of links (html-code) in the contact form?
Thanks and best regards
February 17, 2022 at 5:51 pm #1341211Hey,
Thanks for contacting us!
I am not sure I understood the changes you would like to make clearly. Could you please elaborate? If you have screenshots, please upload them on imgur.com and post the links here :)
Best regards,
YigitFebruary 21, 2022 at 9:48 am #1341599Hey Yigit,
Thanks for the answer.
I would like to prevent clickable links from being sent in the message text via the contact form.
Is there a way to turn these links off?Best regards,
AndreasFebruary 22, 2022 at 5:32 am #1341747Hi,
Thank you for the inquiry.
We might be able to use the pointer-events property to make the links within the message unclickable. Please add this filter in the functions.php file to add the style attribute to the links and set the pointer-events css property to none.
add_filter("avf_contact_form_incoming_mail", function($mail_array, $new_post, $form_params, $cs, $from, $from_filtered) { $mail_array["Message"] = preg_replace('/<a/', '<a style="pointer-events: none; color: inherit;"', $mail_array["Message"]); return $mail_array; }, 10, 6);
Best regards,
IsmaelFebruary 22, 2022 at 10:33 am #1341773This reply has been marked as private.February 23, 2022 at 3:49 am #1341899Hi,
Thank you for the screenshots.
Looks like you have copied the code from your email based on your screenshots. Please make sure to copy the code directly from the forum and check if the code is actually the same as what we posted above.
Best regards,
IsmaelFebruary 26, 2022 at 12:35 pm #1342356Hey Ismael,
thank you very much.
Now the code does not give an error message, but clickable links can still be sent.
Is there perhaps another possibility?Best regards,
AndreasFebruary 28, 2022 at 6:56 am #1342513Hi,
Did you actually send a new message using the contact form? Please note that older messages will not be affected by this filter.
Best regards,
IsmaelApril 22, 2022 at 5:40 pm #1349170Hi,
wie ist denn: “und setzen Sie die CSS- Eigenschaft pointer-events auf none” zu verstehen?April 22, 2022 at 5:45 pm #1349171Hi Tobi,
They are already set to none in the code Ismael shared here – https://kriesi.at/support/topic/html-code-in-contact-form/#post-1341747.
You can simply copy & paste the code into functions.php file of your child theme in Appearance > EditorBest regards,
YigitApril 22, 2022 at 5:53 pm #1349173Hi Yigit, vielen Dank für die Info. Leider funktioniert es nicht … ich habe:
“add_filter(“avf_contact_form_incoming_mail”, function($mail_array, $new_post, $form_params, $cs, $from, $from_filtered) {
$mail_array[“Message”] = preg_replace(‘/<a/’, ‘<a style=”pointer-events: none; color: inherit;”‘, $mail_array[“Message”]);
return $mail_array;
}, 10, 6);”in die function.php eingefügt und mir über meine Website eine Nachricht mit eingefügtem Link geschickt … der Link ist in der Mail dann leider immer noch anklickbar. Muss ich sonst noch was machen?
VG
April 28, 2022 at 8:20 am #1349760 -
AuthorPosts
- You must be logged in to reply to this topic.