3 ms·
I know the spam folder is a special folder, but I assumed you could filter to it. Apparently not. A quick search tells me that you can set up a Google script to
by efreak 2y ago
I know the spam folder is a special folder, but I assumed you could filter to it. Apparently not. A quick search tells me that you can set up a Google script to do this[0]. I personally use the secondary spam tag method, since I don't want such messages being deleted automatically (I filter a number of marketing and other messages to my secondary spam tag, and only check those messages when I need something; in these cases I don't actually want them being deleted automatically)
```
var threads = GmailApp.search("[your search criteria] -is:spam");
for (var iThread = 0; iThread < threads.length; iThread++) {
GmailApp.moveThreadToSpam(threads[iThread]);
}
```
[0]: https://webapps.stackexchange.com/a/120534 https://webapps.stackexchange.com/a/120534