Linux 软件免费装
Banner图

MDL Spam Filter

开发者 mondaydigitallab
更新时间 2026年11月24日 20:25
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPL-2.0+
版权网址: 版权信息

标签

spam contact form ai anti-spam spam filter

下载

1.0.1 1.0.2 1.0.0

详情介绍:

Stop contact form spam before it reaches your inbox. MDL Spam Filter is a lightweight anti-spam plugin for Contact Form 7, WPForms, Gravity Forms, Elementor forms, and almost any other contact form. It uses spam keywords, hidden bot traps, a limit on how fast and how often one visitor can send, a language filter, and optional AI (Anthropic Claude, OpenAI GPT, or another AI service you choose). No CAPTCHA, nothing extra for your visitors to do, and nothing is saved or emailed until a message passes the check. How it protects you MDL Spam Filter checks every message sent through your forms before your form plugin handles it. When a message is spam, it is stopped: no email goes out — not the "new message" email to you, and not any automatic reply to the visitor — and nothing is saved in your form plugin. You decide whether blocked messages are kept in this plugin's own private log. There is nothing to set up per form. It checks any form that asks for an email address, and recognises Contact Form 7, WPForms, Gravity Forms, Ninja Forms and Elementor forms even without an email field. Simple HTML forms and forms that send without reloading the page work too. Check all forms, or only the ones you choose. How a message is checked The quickest checks run first, so most spam is stopped before anything costly happens:
  1. Is it a contact form? Only form messages are checked. WooCommerce checkout and account pages, user registration, login, and password reset are never checked or blocked.
  2. Allow list — senders you trust are always let through.
  3. Block list — senders you have blocked are stopped at once.
  4. Bot trap — a hidden field that only bots fill in.
  5. Minimum time — stops forms sent faster than a person could fill them in.
  6. Submission limit — stops one visitor sending too many messages in a minute.
  7. Language guard — blocks the languages or alphabets you choose, and words disguised with look-alike letters.
  8. Keywords — the built-in spam list plus your own words.
  9. AI — an optional extra check by the AI service you choose.
Steps 2–7 are instant and free. Only steps 8–9 read the message itself, and AI always runs last. What happens to spam. Messages caught by keywords or AI can wait in the Review queue for your decision (on by default) instead of being deleted. Obvious bots (steps 3–7) are always blocked straight away. Either way, you choose what the sender sees: Keywords AI detection (optional, uses your own API key) Review queue Language guard and sender lists Log, privacy and clean-up Email notifications Dashboard and reports Easy to use

安装:

  1. Install the plugin from the Plugins screen, or upload the mdl-spam-filter folder to /wp-content/plugins/.
  2. Activate the plugin from the Plugins screen.
  3. Open the MDL Spam Filter menu in the admin sidebar, then go to Settings.
  4. If you want AI detection, choose an AI service (Anthropic, OpenAI, or another provider) and enter your API key.
  5. Optionally, under Form targeting, choose which forms to check.
After activating The dashboard shows a setup checklist with the same steps. In short:
  1. Check protection is on under Settings → Protection, and choose what a blocked sender sees.
  2. Choose how spam is detected under Settings → Detection engine — keywords only, AI only, or keywords then AI.
  3. Set your email address under Settings → Notifications and click "Send test email" to check delivery.
  4. Send a test message through your own contact form and check it arrives, then keep an eye on the Review and Filter Log pages.
Keywords work with no API key and no outside service.

屏幕截图:

  • Settings page, grouped into sections, with detection and AI options.
  • Notifications: one main address, an on/off switch and optional address for each email, and a test button.
  • Keywords page: built-in keywords grouped by category, with search and per-group toggles, plus your own custom keywords.
  • Filter Log page with search, filters, date sorting, expandable excerpts, bulk delete, and CSV export.
  • Review queue: flagged submissions held before anything is stored or emailed — accept, block, or turn a phrase into a keyword.

常见问题:

Does this work with my contact form plugin?

Very likely. It checks any form that asks for an email address, and recognises popular form plugins (Contact Form 7, WPForms, Gravity Forms, Ninja Forms, and similar) even without an email field. It works with most form plugins and simple HTML forms with no extra setup, including forms that send without reloading the page.

Can I limit which forms are checked?

Yes. Under Settings → Form targeting choose "Selected forms" and add each form by its ID, class, or name (for example #contact-form or .wpcf7-form). Only the forms you list are checked.

Do I need an API key?

No. Keywords work with no outside service. You only need an API key if you turn on AI detection.

What does the visitor see when a message is blocked?

You choose, under Settings → Protection. "Silently discard" shows the form's normal thank-you message while the message is dropped, so bots get no clue. "Show a blocked message" shows a clear message that it was flagged as spam.

Do I still get the "new message" email for spam?

No. When a message is spam, none of the emails it would trigger are sent — not the "new message" email to you, and not any automatic reply to the visitor. This needs the outgoing-email check (Settings → Email & logging) turned on, which it is by default.

Can I use patterns (regular expressions) in keywords?

Yes, as an advanced option. Wrap a keyword in forward slashes to use it as a pattern, for example /\bcheap +rolex\b/. Patterns ignore upper and lower case, and a broken pattern is simply skipped. Every keyword also shows how many messages it has blocked on the Keywords page, so keywords that never match are easy to spot.

The Keywords page says keywords are not in use. Why?

Detection is set to "AI only" and the keyword backup (used when the AI can't be reached) is turned off, so keywords are not used. Switch to "Keywords only" or "Keywords, then AI", or turn the keyword backup back on in Settings → AI engine. With the backup on, keywords can still be edited and are used only when the AI service can't be reached.

Can I tell the AI what counts as spam for my business?

Yes. Under Settings → AI engine, "Detection rules" lets you use the built-in rules, your own rules, or both. Rules are plain sentences such as "Treat requests for electrical or roofing work as spam — we only do plumbing." If you'd rather not write them, the "Draft rules with AI" helper writes them from a short description of your business (with ready-made templates) — check the draft, change it if needed, and save.

What happens if my AI service is down?

By default, if you use "AI only" and the AI service can't be reached (it is down, too busy, or the API key is wrong), the plugin checks the message with keywords instead, so spam doesn't slip through. You can turn this off in Settings → AI engine. In "Keywords, then AI" mode keywords always run first anyway. A message blocked this way shows the reason "Matched keyword (AI unavailable)". You can also get an email when this happens: turn on the AI error email in Settings → Notifications. It tells you about problems such as a wrong or expired API key, no credit left, or the service being down — at most one email per problem every 10 minutes.

How are my API keys stored?

API keys are never included in a settings export. For extra safety, a developer can keep them out of the database completely by adding them to your site's wp-config.php file: define( 'MDLSF_ANTHROPIC_API_KEY', '...' ); (or MDLSF_OPENAI_API_KEY / MDLSF_CUSTOM_API_KEY). When a key is set this way, it is used instead of the saved one, and the settings page shows a note instead of the key field.

Can I limit how many messages one visitor can send?

Yes. Under Settings → Protection, set "Submission limit per minute" to the most messages one visitor can send in a minute. Anything over that is blocked, which stops floods and keeps AI costs down. The default is 20; set it to 0 to turn it off.

What are the bot trap and minimum submit time?

Two free bot checks under Settings → Advanced protection. The bot trap (honeypot) adds a hidden field to your forms that people never see; bots fill it in, so those messages are blocked. The minimum submit time blocks forms sent faster than a person could fill them in (bots usually send instantly). Neither check ever blocks a visitor who has JavaScript turned off or is shown a cached page.

Can I block messages written in another language?

Yes. Turn on the language guard under Settings → Advanced protection and pick a mode. Block selected languages & alphabets blocks messages written mostly in a language or alphabet you tick (by default, everything except Latin). Allow only selected languages & alphabets does the opposite: anything written mostly in a language or alphabet you did not tick is blocked, including ones not listed. Either way, it also blocks words disguised with look-alike letters from another alphabet — a common trick to sneak words like "vіаgra" past spam keywords. Languages with accented letters, such as French, German, or Spanish, count as Latin, and a foreign name or city in a normal message is fine. This check is instant and free, and runs before keywords or AI. The guard looks at the alphabet, not the exact language, so it can't tell apart languages that share one, such as Russian and Ukrainian or English and Indonesian. To allow or block one specific language, use AI detection: add a rule under Settings → AI engine → Detection rules such as "We only serve English-speaking customers — treat submissions written entirely in another language as spam." The AI understands every language, so it judges foreign-language spam by what it says.

Can I always allow or always block certain senders?

Yes. Under Settings → Advanced protection, add email addresses, website domains, or IP addresses to the allow list (always let through) or the block list (always blocked). You can also do it in one click: every Filter Log and Review row with a valid email has a "Block sender" link, and Review rows also have "Allow sender" (senders already listed show "On block list" or "On allow list" instead). Each change is recorded in the Activity Log, and both lists can be edited under Settings → Advanced protection.

What is the Review queue?

A place where suspected spam (caught by keywords or AI) waits for your decision instead of being deleted straight away. It is on by default — turn it off with "Hold suspected spam for review" under Settings → Email & logging. While a message is held, your form plugin does not save it and no email is sent until you decide. The visitor still sees the form's normal thank-you message. You can also get an email when a message is held: turn it on under Settings → Notifications. For each held message you can:

  • View — see every form field, the sender, the page, and why it was held. You can also paste a typical spam phrase into the "add keyword" box to block messages containing it from now on.
  • Accept — email the message to the site admin. It is not added to the Filter Log.
  • Block — delete the message and record it in the Filter Log.
  • Allow sender / Block sender — always let this sender through, or always block them.
Only messages caught by keywords or AI are held. Obvious bots (too many attempts, block list, bot trap, sent too fast, language guard) are always blocked straight away. Because a held message is stopped before your form plugin sees it, Accept sends a plain email with the form fields — not your form plugin's usual email — and no entry is created in your form plugin. Note: some forms (for example WPForms) are handled too early for this, so their suspected spam is blocked and logged instead of held.

Where are blocked messages stored?

Only in this plugin's own log, and only if you turn logging on. They are never saved in your form plugin or email log. Entries don't pile up forever: log and review entries older than the number of days you choose (Settings → Email & logging, default 90 days) are deleted automatically once a day. Set it to 0 to keep entries forever.

Is any message data sent anywhere?

Only if you turn on AI detection, or use the "Draft rules with AI" helper. With AI detection on, the text of each message is sent to the AI service you choose (Anthropic, OpenAI, or another provider) to check whether it is spam. The rules helper also sends the business description you type into it. See External Services below. Fields that look like passwords, card numbers, bank details, or other secrets are never sent and never stored in the log.

What does the Activity Log show?

A record of what happened in the plugin, separate from the Filter Log: settings and keyword changes (which settings changed, never their values), imports and exports, log clean-ups, review decisions, senders blocked or allowed, keywords added from the review queue, weekly digests sent, AI connection tests, test emails, plugin activation, and AI errors. Each entry shows who did it, and entries are deleted after 90 days — change this with "Keep activity entries for (days)" under Settings → Email & logging. Setting values and API keys are never stored here.

Can I export the log or my settings?

Yes. The Filter Log page can export a spreadsheet (CSV) of what you are viewing, using your current search and filters. The Import/Export page copies your settings to another site (API keys are never included), and can also copy just your keywords.

Where do the plugin's emails go?

Set one central address under Settings → Notifications and every email the plugin sends — held messages, AI errors, and the weekly digest — goes there. Leave it blank to use the site admin email. Each email can also be turned on or off and given its own address, so you could send the digest to a different mailbox. You can add several addresses to any field (press Enter or type a comma after each), and any address that is not valid is pointed out when you save. Use "Send test email" to check delivery before you rely on it.

Can I get a summary email instead of checking the dashboard?

Yes. Turn on the weekly digest under Settings → Notifications. Once a week the plugin emails a summary — how much spam was blocked in the last 7 days, how it was caught, the top spam senders, and how many messages are waiting for review — to the central notification address (or the digest's own address; otherwise the site admin email). Nothing is sent in weeks with nothing to report.

Why does System health say the daily cleanup is late?

WordPress runs scheduled tasks only when someone visits your site. On a quiet, test, or local site they can run late, and the System health card tells you instead of hiding it. Visiting your site once usually runs the task. For a reliable fix, ask your host or developer to set up a real scheduled task (cron job) for WordPress — for example by adding define( 'DISABLE_WP_CRON', true ); to wp-config.php and having the server call wp-cron.php every few minutes. If the card says the schedule looks wrong (a daily task set more than a day ahead), turn the plugin off and on again to reset it.

Can developers customise it?

Yes. These hooks are available:

  • mdlsf_predefined_keywords (filter) — modify the built-in keyword list.
  • mdlsf_excluded_requests (filter) — mark additional requests (by your own logic) as non-contact-form so they are never scanned.
  • mdlsf_sensitive_field_keys (filter) — modify the list of field-name substrings excluded from scanning, AI, and logging (passwords, tokens, card numbers, etc.).
  • mdlsf_language_guard_threshold (filter) — adjust the ratio of offending-script letters (0–1, default 0.3) above which the language guard blocks.
  • mdlsf_log_max_rows / mdlsf_quarantine_max (filters) — adjust the filter-log row cap and review-queue size cap.
  • mdlsf_ai_prompt (filter) — modify the classification prompt sent to the AI provider, receiving the full prompt text and the sampled submission content.
  • mdlsf_feedback_enabled (filter) — return false to switch off the optional feedback popup shown when the plugin is deactivated.
  • mdlsf_allow_insecure_custom_endpoint (filter) — permit an http:// custom AI endpoint (e.g. a trusted local model).
  • mdlsf_submission_blocked (action) — fires when a submission is blocked, passing the submitter email and the detector verdict.
  • mdlsf_submission_quarantined (action) — fires when a flagged submission is held in the review queue, passing the submitter email and the detector verdict.

更新日志:

1.0.2 1.0.1 1.0.0