How to Block Form Spam by Country and Language in WordPress
If your business serves one country or one language, a submission from somewhere else, or written in an unexpected language, deserves extra suspicion. Country and language rules are among the simplest ways to cut form spam, as long as you set them up carefully.
Blocking by country
Country rules use the sender’s IP address to place the submission geographically. In Maspik’s Countries Restriction settings you choose either Allow or Block, then pick the countries:
- Allow only the countries you serve, for example the United States and Canada. Everything else is blocked.
- Block the countries your spam comes from, for example China and Russia. Everything else is allowed.
Use Allow if you truly serve a short list of markets, and Block if you only want to remove a specific source. Details are in Countries Restriction.
Know the limit: IP-based location is not perfect. Someone using a VPN can appear to be elsewhere, and a real customer travelling abroad can be blocked by an Allow list. Treat the country as one signal among several rather than the only gate.
Requiring or forbidding languages
Language rules look at the text of the message field. In the Language Restriction settings you can require languages (a message with none of them is marked as spam) or forbid languages. For languages written in Latin letters, the check also includes the relevant diacritical marks to reduce false positives; for German it looks for characters including ä, ö, ü and ß, and for Spanish it includes accented vowels and ñ. See Language Restriction.
Know the limit: if you require a language, a legitimate message that happens to contain none of its characters (for example, a very short message, or only a phone number) will be blocked. Check the log.
A safe way to roll it out
- Look at your spam log or your inbox and note the countries and languages that dominate the junk.
- Start by blocking the one or two worst countries rather than allowing a short list.
- Add a language requirement only if all your real enquiries are in one or two languages.
- Review the spam log after a week and loosen anything that caught a real message. The log shows the country of each blocked entry.
Three scenarios
A local service business
A plumber in one city only serves one country. Using Allow with that country removes almost all overseas junk. The risk is a genuine customer abroad, such as a landlord enquiring from another country, so keep an eye on the log.
A global product with a few problem regions
A software company has customers everywhere, so Allow would be too strict. Using Block for the one or two countries that dominate the spam is safer.
A multilingual site
If your visitors write in English and Spanish, require those two languages. A message in an unexpected script is then marked as spam. If you serve many languages, skip the language rule and rely on content rules instead.
Frequently asked questions
Are country and language rules in the free Maspik plugin?
No. They are Pro features.
Can a VPN get around a country rule?
Country rules use the sender’s IP address, so a visitor using a VPN can appear to be in another country. Treat the country as one signal among several.
What happens to a blocked message?
It is marked as spam and recorded in the spam log, with its country, so you can review it.
Do the rules apply to every form?
Maspik’s settings apply across the forms it protects on your site, instead of being configured form by form.
What you need
Country and language restrictions are Maspik Pro features and work with every supported form plugin. See pricing, and the list of supported forms. If you already use WPForms’ own country filter, note that it applies per form; Maspik’s settings apply across your site.