How do we search for all our archived messages in Gmail?
Non-archived messages should not be displayed,
Only the archived messages should be shown.
In the Gmail search box, type
-label:inbox -label:sent -label:drafts -label:notes
and press enter. That should give you all your archived messages. Once there, select All and then click Select all conversations that match this search to ensure that all messages are selected. Click Delete.
They'd still go the the Trash though so you'd have to empty the Trash as a final step.
Our company's email is hosted by Google Apps, and I asked Google Enterprise Support the same question. They answered that the search syntax for archived messages is:
has:nouserlabels -in:Sent -in:Chat -in:Draft -in:Inbox
Here's the reference documentation for Gmail's search: https://support.google.com/mail/answer/7190?hl=en
-in:inbox for archived messages.
in:anywhere -in:inbox for messages archived, in Spam and in Trash.
In the Gmail Help lingo context, archive a message means removing it from Inbox, without asigning any label, but in a broadsense archived messages could means messages that moved from the Inbox to some place where it could be found later.
in:anywhere in the Gmail search box and hit enter. If the Conversation view is enabled this will return all the conversations in the current Gmail account mailbox including those messages indidually marked as Spam, deleted if the still are in Trash and the conversations in Inbox.
To find messages that are not in Inbox, nor in Spam nor in Trash type