[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

【WordPress】コンタクトフォームに超簡単なスパム対策を入れる

システム部の山田です。
今日はWordpressのおはなしです。

WordPressには「Contact Form 7」というフォーム作成用プラグインがあって
ちょっとしたお問い合わせフォームみたいなものはすごく簡単に作ることができますが、
ちゃんと工夫しないとスパムの踏み台にされちゃいますよね。

でもスパム対策なんてどうすればいいかわからない、
あんまりプラグインを入れたくない、っていう方のために
ちょー簡単にできるスパム対策をご紹介します。

それがこちら↓
図1

Contact Form 7の「承諾確認」タグを利用します。
これを使うことで送信前にチェックを入れないと送信できなくなるので
自動でスパムを送るようなプログラムを「だいたい」阻止できる、という寸法です。

 

使い方は簡単で「承諾確認」ボタンを押すとこのようなダイアログが現れます。
図2
ここで任意のidとclassを設定して(設定しなくても使えます)
「タグを挿入」ボタンを押すと・・・

 

フォームのソース上に「承諾確認」用のタグが挿入されます!
図3

 

で、チェックを入れないと送信ボタンが押せないようになります(^^)
採用情報_株式会社ビヨンド_-_2016-05-19_13.22.22
送信ボタンが押せなくなった!

 

が、一つ注意点。
他の必須項目であれば入力チェックがかかりますが
この「承諾確認」はデフォルトだと入力チェックのエラーメッセージが表示されません。

チェックの入れ忘れに気付いてもらえない心配があるなら、
「その他の設定」に以下のコードを入力します。

acceptance_as_validation: on

 

これで「承諾確認」にも入力チェックがかかるようになります。
採用情報_株式会社ビヨンド_-_2016-05-19_13.23.52

エラーメッセージが表示されたよ!

 

すべてのスパムを完全に対策できるわけではありませんが、
少ない手間でかなりの効果が期待できるので是非お試しを!!

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
0
読み込み中...
0 票, 平均: 0.00 / 10
955
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author