Currently reading: Stories of Your Life and Others by Ted Chiang

Smoother Google search results declutterer

But not that smooth since it kind of requires that you (a) use DuckDuckGo for searching to take advantage of their so-called bangs, (2) often add !g to those searches whenever you foresee bad results, and (d) that you install an extension.

I previously posted a userscript-based solution for automatically sending you to Google's cleaner but "hidden" udm=14 mode, but I wasn't altogether satisfied with how it worked. Having already used the Redirector extension for a good while, I knew I had better tools available than a script that had to check URL parameters and attach to a navigation element ⸺ both of which might change at any moment.

I guess in the end it's more an insight into how my (dumb) brain works, because who's really gonna change their personal "tech stack" for accomplishing a very particular task like this?


Once the Redirector extension is installed, edit its redirects list. We're gonna add one that uses regex to sniff out !g searches while disregarding other Google bangs that we still want to function. For instance, we don't want !gi to forward us to udm=14 because we'll do a web search instead of an image search as desired.

Click the button to add a new redirect, and in the pop-up add the following:

Description:     DDG to UDM 14
Example URL:     https://duckduckgo.com/?t=ffab&q=%21g+slowbro+is+cool
Include pattern: https://duckduckgo.com/\\?t=ffab&q=(.*)%21g(?![dfimnst])(.*)
Redirect to:     https://google.com/search?q=$1$2&udm=14
Pattern type:    Regular Expression
Description:     You can leave it empty or add a note to reminder yourself what it's doing.

The key part of this regex, q=(.*)%21g(?![dfimnst])(.*), uses a negative lookahead to check for !g except when immediately followed by any of the characters in the brackets. This allows us to forward basic text searches to udm=14 while leaving alone other bangs like !gm (maps), !gn (news), and !gs (shopping) to so they'll function as normal.

Save your work, put [search term] !g and !g [search term] into your browser's URL bar, and send it. If you land on Google with udm=14 in the URL in both cases, you've done it! Now test that it doesn't forward you to the "secret" decluttered mode if you do !gi or !gm and the like.

Alternatively, you can copy-paste the following into a .json file and import it into the expansion. Much easier, but sometimes it's good to do things manually so you can mess around a bit and see how they work.

{
    "createdBy": "Redirector v3.5.3",
    "createdAt": "2025-01-31T05:47:12.543Z",
    "redirects": [
        {
            "description": "DDG to UDM 14",
            "exampleUrl": "https://duckduckgo.com/?t=ffab&q=slowbro+is+cool+%21g",
            "exampleResult": "https://google.com/search?q=slowbro+is+cool+&udm=14",
            "error": null,
            "includePattern": "https://duckduckgo.com/\\?t=ffab&q=(.*)%21g(?![dfimnst])(.*)",
            "excludePattern": "",
            "patternDesc": "Sends all \"normal\" Google bangs to the deshittified version.",
            "redirectUrl": "https://google.com/search?q=$1$2&udm=14",
            "patternType": "R",
            "processMatches": "noProcessing",
            "disabled": false,
            "grouped": false,
            "appliesTo": [
                "main_frame"
            ]
        }
    ]
}

As an added bonus, this method is actually faster than going through DDG's servers. Redirector will see the matching URL and send you to Google directly, bypassing DDG and its processing entirely. You're only waiting on one server response (Google) instead of two (DDG and then Google). How neat is that?

Leave a comment

Your email address will not be published. Required fields are marked *