Gmail Language Filter to Block Foreign Emails

If there’s an email 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 archived to 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.

lang:af OR lang:am OR lang:ar OR lang:az OR lang:be OR lang:bg OR lang:bh OR lang:bn OR lang:bo OR lang:ca OR lang:chr OR lang:cs OR lang:da OR lang:de OR lang:dv OR lang:el OR lang:eo OR lang:es OR lang:et OR lang:eu OR lang:fa OR lang:fi OR lang:fr OR lang:gl OR lang:gn OR lang:gu OR lang:hi OR lang:hr OR lang:hu OR lang:hy OR lang:id OR lang:is OR lang:it OR lang:iu OR lang:iw OR lang:ja OR lang:ka OR lang:kk OR lang:km OR lang:kn OR lang:ko OR lang:ku OR lang:ky OR lang:lo OR lang:lt OR lang:lv OR lang:mk OR lang:ml OR lang:mn OR lang:mr OR lang:ms OR lang:mt OR lang:my OR lang:ne OR lang:nl OR lang:no OR lang:or OR lang:pa OR lang:pl OR lang:ps OR lang:pt-PT OR lang:ro OR lang:ru OR lang:sa OR lang:sd OR lang:si OR lang:sk OR lang:sl OR lang:sq OR lang:sr OR lang:sv OR lang:sw OR lang:ta OR lang:te OR lang:tg OR lang:th OR lang:tl OR lang:tl OR lang:tr OR lang:ug OR lang:uk OR lang:ur OR lang:uz OR lang:vi OR lang:zh OR lang:zh-CN OR lang:zh-TW

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

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

0

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.