Reduce Spam in your Gmail Inbox with a Language Filter

If there’s a message in my Gmail Inbox that’s not written in English, chances are high that it is some sort of spam because almost all my contacts use the English language for email communication.

All foreign language emails get archives in a different folder

gmail foreign spam

Now Gmail has an undocumented search operator called lang: to help you search messages in your mailbox that are written in different languages. For instance, lang:ru will show messages written in Russian while lang:zh or lang:zh-tw will return emails that contain Chinese text.

Unlike other Gmail search commands, the language search operator is not always perfect but can still help you remove most of the foreign language emails from the main Inbox very easily. For that to work, just set up a filter like this:

gmail language filter

That may look at bit confusing but it’s actually very simple – you first ask Gmail to search all messages that are not in your native language, apply a label to these messages and then move them out of the main Inbox.

Here are the steps involved for creating a language filter in Gmail:

1. Create a new filter in Gmail and copy-paste the following in the “Has Words:” field but before that, please make sure you remove codes for all languages that you normally use for communication.

For instance, if your get emails in English and Hindi, just remove lang:en and lang:hi from the list. Check this page for a complete list languages that can be detected by Google Language API.

2. In the next step, say “Skip Inbox” (Archive It) and apply a Label “Foreign Spam”. Your Gmail filter is now ready to catch spam. You could say “Delete” instead of “Archiving” but I prefer the latter option to catch false positive, if there’re any.

Gmail’s built-in spam filtering technology is also pretty good at handling foreign language spam but this filter adds another layer of protection to the Inbox so you spend less team cleaning all the junk stuff.

Related: How to Identify Foreign Languages

Find this article at: http://www.labnol.org/internet/gmail-language-filter-reduces-spam/9000/

Tags: , , , , , Internet

Reader Comments

You may want to also exclude messages from something like your blog’s spam management system by adding:
from:blogsite@yourdomain.com

to the “Doesn’t have” field (where “blogsite@yourdomain.com” is replaced by the specific address in your own case)

In gmail, using () means there’s an implicit AND between every word and using {} means there’s OR between them. So instead of writing

lang:af OR lang:am OR lang:ar OR lang:az OR lang:be

write

{lang:af lang:am lang:ar lang:az lang:be}

Works on filetypes etc as well…

Couldn’t you also just say anything that doesn’t match English?

Something like
Matches: -lang:en

What if there is just a single word in a banned language. You will not receive the email ?
Anyway this seems like a very good idea to get rid of this anoying spam.

“what if there’s a single word of a banned language” – That’s the reason why I am putting foreign language mails in a new folder else we can ask gmail to just delete them automatically.

I’m not quite sure why you included lang:en AND lang:UK as most people reading your blog probably don’t want to flag American English and UK English as spam.

xxd – the lang:uk will filter emails written in Ukranian language not UK english.

I purposely included all languages in the filter so that even non-English Gmail users can benifit here. There’s a note saying – “Make sure you remove codes for all languages that you normally use for communication.”

Google Custom Search