Yeni Alımlara Özel Türkiye Lokasyon (VDS/VPS) Ürünlerinde %50 İndirim Fırsatı! Kaçırmayın... (Stoklarla Sınırlıdır)

Arama Yap Mesaj Gönder

Biz Sizi Arayalım

+90
X
X
X
X

Knowledge Base

Homepage Knowledge Base General Protecting Against Fake Submissions...

Bize Ulaşın

Konum Halkalı merkez mahallesi fatih cd ozgur apt no 46 , Küçükçekmece , İstanbul , 34303 , TR

Protecting Against Fake Submissions from Web Forms: A Detailed Guide for PHP and WordPress

Forms on websites, such as contact, registration, reservation, and quote request forms, are indispensable components of digital interactions. However, these forms are highly susceptible to abuse by spam submissions, bots, and fake users. Especially even when reCAPTCHA is used, if spam forms are still being received, more advanced measures are necessary.

In this article, we explain more than 10 advanced security techniques that can be applied to combat fake forms, both on PHP-based sites and WordPress-based systems, step by step with example code.


1. Google reCAPTCHA v2 / v3 Usage

  • Using reCAPTCHA v2 (“I’m not a robot”) or v3 (background risk analysis) reduces spam.

  • However, advanced bots can pass reCAPTCHA v2. Therefore, it is not sufficient on its own.

PHP Example:

$response = $_POST['g-recaptcha-response'];
$remoteip = $_SERVER['REMOTE_ADDR'];
$secret = 'YOUR_SECRET_KEY';
$verify = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}&remoteip={$remoteip}");
$captcha_success = json_decode($verify);
if (!$captcha_success->success) die("Bot detection");

2. Honeypot Method

Hidden fields that the user does not see but bots fill in.

PHP:

if (!empty($_POST['honeypot'])) {
  die("Bot detection!");
}

HTML:


Plugin for WordPress:

  • WP Armour – Honeypot Anti Spam


3. Form Submission Time Control

Bots usually fill out the form very quickly. Applications received in less than 3 seconds can be rejected.

session_start();
if (time() - $_SESSION['form_start'] < 3) die("Sent too quickly, may be a bot");

‍♂️ 4. IP and User-Agent Control

Block the same IPs or invalid user-agents that come with a large number of forms.

if ($_SERVER['HTTP_USER_AGENT'] == '' || preg_match('/curl|bot|python/i', $_SERVER['HTTP_USER_AGENT'])) die("Bot detection");

5. Smart Form Field Analysis

Bots usually fill in every field. However, if logical data is not entered in optional fields, this may be spam.

  • If no field is left blank > suspicious

  • If random characters are entered in the name > suspicious


6. IP and Country Based Blocking

Block bots from certain countries with Cloudflare or GeoIP.

  • PHP GeoIP

  • For WordPress: iQ Block Country


7. Two-Factor Authentication (Form confirmation email)

An email is sent to the user after the form is submitted. No action is taken unless confirmed.

  • Especially recommended for quote/reservation forms.


8. JavaScript Controlled Submit

Trigger the form submission process only with JS. Non-JS systems (bots) cannot submit.

document.querySelector("form").addEventListener("submit", function(e) {
  // this check should be done on the server
});

9. In Addition to reCAPTCHA: Friendly CAPTCHA or hCAPTCHA

  • Friendly CAPTCHA → more comfortable in terms of user experience

  • hCAPTCHA → more visual testing, Google reCAPTCHA alternative

For WordPress: hCaptcha for WordPress plugin


10. Smart Logging + Manual Review

  • Which IPs have submitted how many times and when?

  • In which fields is the same data always entered?

  • Keep track of these by keeping logs

$log = date("Y-m-d H:i:s") . " | " . $_SERVER['REMOTE_ADDR'] . " | " . $_POST['email'] . "\n";
file_put_contents("form_log.txt", $log, FILE_APPEND);

11. Spam Detection with Content Control (with Regex)

Block if there are certain character patterns in the email, name, message fields:

if (preg_match('/(viagra|casino|win money|bit.ly|http\:|https\:)/i', $_POST['message'])) {
  die("Spam content detected");
}

12. Akismet Usage (WordPress Recommendation)

  • Akismet is WordPress's spam filtering system.

  • It is especially effective against comment + form spam.

  • Works integrated with Gravity Forms, Contact Form 7.


13. Jetpack Anti-Spam (Premium)

  • Provides IP-based data in addition to form field analysis

  • Recommended for WordPress-based corporate sites


Additional Security Steps

  • Publish all your forms over HTTPS

  • Create a "Blacklist" for frequently received spam data (example emails, names)

  • Show your forms only to logged-in users (like WordPress comment form)


Conclusion: A Layered Approach is Essential for Form Security

reCAPTCHA alone is not enough to protect a web form. Especially in widespread systems like WordPress, bots can target forms by exploiting plugin vulnerabilities. Therefore, it is necessary to use methods such as honeypot, time control, content analysis, and IP restriction together.

It is recommended to use at least 4-5 of the methods in this list together for a structure that will stop spam by 95% without disrupting the user experience. 

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(482 times viewed / 39 people found it helpful)

Call now to get more detailed information about our products and services.

Diğer Hizmetlerimiz

Web siteniz için uygun fiyatlı Ucuz Hosting Paketleri ile yüksek performanslı barındırma hizmeti sunuyoruz.

Dijital varlığınızı güçlendirmek için profesyonel Sosyal Medya Hesap Yönetimi hizmeti sağlıyoruz.

Görsellerinizi sıkıştırmak için kullanışlı PNG to WebP dönüştürücümüzü deneyin.

Resim boyutlarını küçültmek isteyenler için JPG to WebP aracı idealdir.

SEO uyumu için Robots.txt Oluşturucu aracımızı kullanabilirsiniz.

Htaccess Oluşturucu ile yönlendirme ve erişim ayarlarınızı kolayca yapın.

Kullanıcı deneyimini artırmak için özgün UI/UX Tasarım çözümleri sunuyoruz.

Hızlı ve güvenli kurulum için WordPress hizmetimizden faydalanın.

Sitenizi arama motorlarında yükseltmek için Google Optimizasyon hizmeti sunuyoruz.

Markanızı tanıtmak için Tanıtım Yazısı içerikleri üretiyoruz.

UGC ile içerik gücünüzü artırın: UGC İçerik.

Profesyonel Yazılım Kurulum hizmetleri sunuyoruz.

Kaliteli içerik arayanlara özel Hazır Makale & İçerik Satışları.

Sıra Bulucu ile arama motoru sıralamanızı takip edin.

Google Haritalara Kayıt ile konumunuzu haritada gösterin.

Alan adı otoritenizi öğrenin: DA PA Sorgula.

Dış bağlantılarınızı analiz edin: Dış Link Aracı.

Dahili link yapınızı inceleyin: İç Link Aracı.

Arama motoru başarınızı artırmak için SEO Danışmanlığı alın.

Organik trafiğinizi artırmak için SEO çözümleri geliştirin.

Özel çözümler için Mobil Uygulama geliştirme hizmeti sunuyoruz.

Markanız için Logo tasarlıyoruz.

İşinize özel Web Yazılım çözümleri sunuyoruz.

Kurumsal imajınızı yansıtan Kurumsal Web Tasarım hizmeti.

Süreçlerinizi hızlandırmak için Bot Program geliştiriyoruz.

Online satışlarınız için Sanal POS sistemleri sunuyoruz.

Entegrasyonlar için Pazaryeri ve Kargo Entegrasyonu.

Kullanıcı deneyimi testleri için Son Kullanıcı Testleri.

İçerik indirimi için TikTok Video İndir aracı.

Görsellerinizi kolayca küçültün: Resim Boyutlandırma.

Yararlı kod örnekleri için Site Kodları rehberine göz atın.

Kodları online inceleyin: HTML Viewer.

IP adresinizi öğrenmek için IP Adresim Nedir aracını kullanın.

Bağlantı hızınızı test etmek için Hız Testi.

DNS önbellek sorunları için DNS Cache Problemi sayfasını inceleyin.

DNS değişikliklerini görmek için DNS Önizleme aracı.

IDN dönüştürme için IDN Çevirme kullanın.

Sunuculara ping atmak için Ping Gönder özelliğini deneyin.

Web sitenizin yanıt süresini test etmek için Web Site Ping aracımızı kullanın.

Top