A company I work with uses Gmail to log exception emails from our Ruby on Rails application. This allows us to always capture issues with the application and keep a lengthy history of all the issues without using up disk space on the server itself. Sometimes if there is an issues on a development server that is not fixed right away we may get thousands of emails into the Gmail account that are all the same and it benefits us to clear these out from time to time since they can number over 50,000 at times. The example image below shows our Ruby on Rails application exception inbox from Gmail.
Gmail Exceptions Emails Sent From Ruby Application:
As you can see in the above image there are many of the exact same message in the inbox. In fact there were over 20,000 messages sent from the Ruby application that I needed to delete from the Gmail inbox. Follow the directions below to search for a specific message and then delete all of those messages with a couple key strokes instead of trying to delete 20 at a time from the Gmail search results.
Delete Thousands Of Gmail Messages At The Same Time:
- Open Gmail Search Options: From the Gmail inbox page click on “Show Search Options” which is to the right of the Search field at the top of the list of Gmail messages. Once you click on Show Search Options the below Gmail Search box will appear above the Gmail inbox.
- Enter Search Details: This step is really important so you don’t accidentally delete messages that you do not want to delete. Enter in the search details similar to the below example and then click the Search Mail button to display the Gmail search results.
Again make sure the details entered will only provide results that match the exact emails you want to delete from Gmail.
- Select All Messages: Now click the All link located above the list of search result messages and to the right of “Select”. This will select all of the 20 messages in the list of search results as shown in the below example image.
Keep in mind that when you select “All” it doesn’t mean all of the search results but only the 20 messages displayed in the first page of Gmail search results.
- Select All Search Result Messages: After clicking All the 20 messages on the first page of the search results will be selected but also a link will appear right above the list of messages that is titled “Select all messages that match this search”. Click that link, which is displayed in the example image used in step 3, to select all messages in the search results. After clicking the link the message will change to “All conversations in this search are selected” as shown in the below example image and means you have successfully selected all Gmail search results.
Again keep in mind that you will be blindly deleting many messages so make sure you issued the correct search from within Gmail.
- Delete Gmail Messages: With all of the Gmail search results selected click the Delete button which will open a confirmation pop up message as displayed in the below example image asking you to confirm that you want to delete all of the messages.
- Verify Messages Deleted: Now after confirming that you want to delete all of the search results the Gmail search results will be empty as displayed in the below example image.
- Empty Gmail Trash: You have Gmail configured to automatically empty the trash upon exiting Gmail however you can also visit the Trash folder and manually empty the Trash.
It is easy to miss the link provided by Google at the top of Gmail since you have to select all of the messages on the first page of the Gmail search results. Just make sure that when you issue the search you match only the messages you want to delete since you will not be able to visually verify all of the messages you will be deleting.