Is there a way to filter messages in the Chrome console?
By example, I don't want to see messages from/containing the JQMIGRATE...

- 4,997
- 5
- 25
- 35

- 13,940
- 35
- 121
- 205
-
I think messages from JQMIGRATE are there for a reason, and in turn, removed once you've migrated (upgraded to a newer jQuery I think?) & removed the JQMIGRATE plugin. – brandito Jul 16 '18 at 03:36
-
Since chrome 94 you can do this with a simple invert check box next to the network tab search. – AnandShiva Jan 15 '22 at 06:59
4 Answers
You can negate filters by prepending with -
. For example, -JQMIGRATE
will exclude messages containing the string "JQMIGRATE".
Regex filters can also be negated this way. e.g. -/^DevTools/
will exclude messages that begin with "DevTools".
(Credit goes to Donald Duck, who suggested this in a comment on the chosen answer. I thought it was a far cleaner solution than negative lookaheads, and deserved to be elevated to a top-level answer.)

- 8,775
- 6
- 33
- 37
-
Very useful! Is there any way to filter based on multiple words? The error message I get doesn't have a word that isn't used in other error messages. I tried to add quotes around the sentence but that didn't work for me – Y. Gherbi Nov 30 '21 at 21:06
-
8@Y.Gherbi in the regex, you can type `\s` to signify whitespace, `-/^DevTools\sfailed/` filters out all lines starting with "DevTools failed". – Wolfzoon Dec 23 '21 at 16:41
-
I think you can. Recent chrome versions allow filtering using regular expressions by enclosing the search pattern in /.../
, previous versions had a checkbox. You can express, for instance, "not bar" by using negative lookaheads, as described here How to negate specific word in regex?
In the picture below, I tried filtering for "not bar".

- 6,269
- 2
- 26
- 37
-
1Doesn't work for me. I have storybook running and by default it prints out some messages like "message arrived at manager..." -- I tried to turn this off by typing what you showed above: /^(?!.*message).*$/ -- still all messages are shown, no effect. – Darko Maksimovic Nov 28 '19 at 14:37
-
13You don't need to use `?!` in this case. To filter out only the word `bar`, it's enough to do `-bar` (without regexes). You can also use the `-` on a regex, for example you can do `-/foo\sbar/`. – Donald Duck Feb 29 '20 at 12:26
I've found this to simple filter all console messages from extensions. This will also persist until you clear the filter. Type -chrome-extension:
. This will REMOVE any messages that come from -> chrome-extension:
<- urls.
You can use multiple filters by putting a space between each query. Ex. -chrome-extension: -cookie
. Notice the space after the :
and before the -c
. This will REMOVE any messages that come from -> chrome-extension:
<- urls and also REMOVE any messages with cookie
in the context.
Using Chrome Version 80.0.3987.132 (Official Build) (64-bit)

- 485
- 5
- 10
The accepted answer works for single line filtering, but I found it also filters out any multi-line logs. See the following examples.
No filter:
Accepted answer (missing multi-line logs):
Fixed negative filter (correctly keeps multi-line logs):
/^((.|\s)(?!Violation))+$/
Bonus! Easy filtering out multiple matches:
/^((.|\s)(?!Violation|creating))+$/

- 143
- 2
- 6
-
How to mix those? For example I already have there something like: "-url:http://example.com" and now want to add a regular expression. How to do it? – Onkeltem Jan 28 '20 at 11:14