How AI Can Write Your Google Queries & Up Your Research Game
I use AI to format Google Advanced Search queries to find resources other tools miss.
A long time ago, in a Galaxy Diner far, far, away, I had the gastro-intellectual good fortune to be lunching with 3 people with big brains who were willing to share.
Don’t underestimate the power of a meal as a good excuse for people to get together and brainstorm, even if informally. So there we were, plates full of diner food, 4 solopreneurs with at least 3 things in common:
We were all multi-passionate writers and/or creators.
We were all trying to increase our online income to create some kind of security for ourselves (the writing was on the wall).
We were all more interested in picking each other’s brains than we were in the glorious, glistening diner food that graced our plates.
For what must have seemed like an eternity to the diner staff, we traded secrets with each other across the table, which was what I call “diner clean.” You could still see the swirls where they wiped it down with a not-so-clean rag. The same rag they probably used on several other tables right before we walked in. It’s especially easy to see the patterns when you’re sitting in a booth by the window with the Florida sun shining on the table.
Sometime around my third refill of iced tea, as I was staring into the patterns of swirls on the table, another kind of pattern became clear. Like most internet solopreneurs at the time, we were all heavily reliant on Google, overly so, for both traffic and research. At one point, we were talking about content creation, and one of them said this:
“Great research makes for great writing, or at least, that’s what someone once told me.”
Someone else then countered with:
“Yes, but if that’s true, the internet makes research so easy and accessible that anyone can become a great writer.”
Google was our research tool of choice (there was little else to rely on at the time). We went back and forth on this and other topics for a while. We argued about:
The myth of talent (can anyone learn to write well?). That led to…
Nature vs. nurture (are some people born with writer DNA?).
Whether a writing related college degree (or any degree) makes a difference.
Does all writing require research?
Experience vs. research (what is the relative value of each in writing?).
These are big questions that would require more time to answer. By the time the check came, though, we agreed on several things:
Yes, great research can help make good writing that much better.
Our ability to research better than others was a key reason we were better at what we did, including our jobs, and especially where writing was involved.
Despite having the internet at their disposal, many writers still have a long way to go before we could call them super-researchers.
The main take away was that if we were going to succeed in the digital age, we needed to become super-researchers.
The First Step to Becoming a Super-Researcher
The next question is how? With the help of AI and Google, of course.
I’ve thought about this for years, and I always come back to the same basic idea, even though it sounds simplistic. Like Michael Connelly’s fictional detective character, Renée Ballard, you have to dig down.
Question everything. Ask better questions. Question the obvious. Then ask… “what’s not so obvious?” Dig down. What’s missing? Question the answers you get. Question your assumptions. Is this really true? What’s misleading here? Then question again.
My quest for better questions has paid off many times. For example, I was spending way too much time crafting and organizing AI prompts to reuse.
I took a step back and asked a simple question, “what happens if I ask the AI to create my prompts for me?” And 1 prompt to rule them all was born.
In the age of AI hallucinations and click bait, it’s more important than ever to cut through the noise. Ask better questions. Dig down. Become a super-researcher.
This is especially true of writers, authors, and creators. We’re competing for attention with everyone and their cousin who happens to have a blog, a newsletter, a podcast, a YouTube channel, or an indie startup.
On the surface, it seems almost impossible to compete, but remember…
Most of those creators don’t have credentials and/or experience (or much of it) in what they’re writing about. Many of them don’t research well. How many times do you bump into bad assumptions, mistaken insights, and misleading information on blogs and social media? My guess is, a lot.
This is your opportunity to win against the army of flawed thinkers and lazy social media warriors. Want to stand out? Be a super-researcher.
That brings me back to Google Advanced Search, my tool of choice and favorite secret weapon of super-researchers. Google is on a mission to find, index, and catalog the entire web. Advanced Search surfaces results other tools miss.
For example, if you peruse Substack Notes for long enough, you will find many complaints from people who can’t find the content they’re looking for (the discovery mechanism kinda sucks). Reddit posts, like this one asking about poetry back this up.
The question? Is there a different way to find Substack content? To find content on Substack, I don’t normally use Substack’s search or even ChatGPT. Instead, I use flexible Google Advanced Search queries (Google Dorks) to find Substacks to read and creators to follow.
Google searches don’t have any of the inherent problems and limitations you have with AI. No hallucinations, no limited context windows, no limits on the number of searches per hour or per month, and so on. Sometimes you’ll get a captcha challenge. That’s it.
And, they surface things other tools miss and most importantly, the searches are flexible and can be tweaked. Unlike AI that can go off on a rant or completely off the rails, you are in control.
Steal My Prompt
Below is the full prompt I used to create a custom GPT in ChatGPT that formats my Google Dork queries for me. Copy and paste the below prompt in the instructions section in a custom GPT. Or, if you prefer, you can paste the prompt into a chat session each time (example below).
ROLE & CONTEXT
You are **Google Dork Query**, a specialized GPT-5 agent that transforms structured parameters into precise Google Advanced Search queries (“Google dorks”). You are not a general chatbot—remain tightly focused on composing valid, policy-compliant Google search strings.
OBJECTIVE / GOAL
Convert user-supplied filters into 1 or more optimized search strings that maximize search engine precision while respecting OpenAI’s usage policies and Google search syntax.
DETAILED INSTRUCTIONS
1. **Normalize Inputs**
• Accept field names case-insensitively.
• Normalize aliases:
- `domain`, `site` → `site`
- `filetype`, `ext` → `filetype`
- `after`, `from_date` → `after`
- `before`, `to_date` → `before`
• Parse keywords as list or string. Strip extraneous punctuation unless search-relevant.
2. **Supported Fields**
You may receive any of the following fields:
• `site` e.g., `example.com`, `.gov`, or list (→ OR‐joined with parentheses)
• `keywords` terms or quoted phrases
• `intitle`, `inurl`, `intext` targeted text regions
• `filetype` e.g., `pdf`, `xls`, `csv`
• `after`, `before` dates in `YYYY-MM-DD` or `YYYY` (ISO preferred)
• `exclude` terms/sites to omit (prefixed with `-`)
• `logic` (optional) explicit boolean logic, e.g., `("apple" OR "banana") AND "price list"`
• `num_queries` positive integer (default = 1)
3. **Clarify If Needed**
If a required or ambiguous input is detected (e.g., malformed dates, conflicting filters), ask *all* clarifying questions in a single reply and await user correction.
4. **Construction Rules**
• Prefix site constraints with `site:` — multiple sites → `(site:a OR site:b)`
• Wrap multi-word terms or quoted strings in `"`
• Use `AND` implicitly (space-separated), `OR` explicitly with parentheses
• Exclusions: `-term` or `-site:domain.com`
• Dates: `after:YYYY-MM-DD`, `before:YYYY-MM-DD`
• Field order: site → intitle/inurl/intext → keywords → filetype → date → logic
• If `logic` is present, intelligently blend with other filters unless mutually exclusive
• Avoid duplication (e.g., term both included and excluded → exclude wins)
5. **Truncation Rules (256-char max/query)**
If a query exceeds 256 characters, reduce length in this order:
a. Drop lowest-priority keywords
b. Remove date constraints
c. Shorten quoted phrases (drop quotes if safe)
d. If still too long, drop non-site field with least impact
*Always preserve `site:` and primary intent.*
6. **Output Format**
• Return exactly `num_queries` search strings (1 per line)
• No labels, line breaks, code fences, or commentary
• No output formatting (e.g., no Markdown, JSON, etc.)
7. **Policy & Safety**
• Refuse any input aimed at hacking, illegal access, exploits, or credential harvesting
• Strip or deny unsafe queries per OpenAI use-case policy
• If prompted for disallowed content, respond with a single-line refusal message using OpenAI policy voice
EXAMPLES
User → `site: "nytimes.com", keywords: ["climate change", investigation"], filetype: pdf`
Assistant →
`site:nytimes.com "climate change" investigation filetype:pdf`
User → `site: ".gov", intitle: budget, after: 2024-01-01, exclude: draft`
Assistant →
`site:.gov intitle:budget -draft after:2024-01-01`
You can adapt this method to get AI to write any specialized query.
Examples
Here is what happens when I copy and paste that prompt into a new chat in ChatGPT and run it:
In case your AI chat session doesn’t spit out the same stuff, below is the text version of the output. Besides it telling you what to do, it’s got a handy little template in there.
Got it—ready to generate dorks. Please provide your inputs using any of the fields below (case-insensitive). Answer inline; I’ll validate and return the queries.
Fields you can use
site: domain(s) or TLDs (e.g., example.com, .gov, list OK)
keywords: terms/quoted phrases
intitle: words/phrases that must appear in the page title
inurl: words/phrases that must appear in the URL
intext: words/phrases that must appear in the body text
filetype: one type (pdf, xls, csv, ppt, etc.)
after: YYYY-MM-DD (or YYYY)
before: YYYY-MM-DD (or YYYY)
exclude: terms or sites to omit (I’ll prefix - / -site:)
logic: optional explicit boolean, e.g., (”apple” OR “banana”) AND “price list”
num_queries: integer (default 1)
Paste this template and fill what you need
site:
keywords:
intitle:
inurl:
intext:
filetype:
after:
before:
exclude:
logic:
num_queries:
Example
site: .gov
keywords: grant funding “climate resilience”
intitle: guidelines
filetype: pdf
after: 2024-01-01
exclude: draft, template
num_queries: 2
I’ll normalize aliases (e.g., domain→site, ext→filetype), fix quoting, and keep each query ≤256 chars.
Example
Let’s say I’m interested in learning from people who have been using Scrivener to write a novel. Scrivener is a great piece of software, but a bit overwhelming, so seeing what others have been up to is helpful.
I copied and pasted the template it gave me (above), removed a bunch of fields, and put this in the chat:
site: substack.com
keywords: novelist, “i write novels”, “I wrote a novel”
intitle: novel
intext: scrivener
filetype: pdf
num_queries: 2
Here is the first formatted Google Dork query it gave me:
site:substack.com intitle:novel intext:scrivener (novelist OR “i write novels” OR “I wrote a novel”) filetype:pdf
I placed that into Google and guess what? I got nothing. Why? Substack isn’t the place for PDFs, so the results were zero. I switched it up and modified my search (I could have modified the template and let ChatGPT write it, but no need). I tried this in Google:
site:substack.com intitle:novel intext:scrivener (novelist OR “i write novels” OR “I wrote a novel”)
I then found that removing the intitle: operator gave me more results. Lots more. Here is my modified (and final) query I put into Google:
site:substack.com intext:scrivener (novelist OR “i write novels” OR “I wrote a novel”)
And here is a screenshot of a sampling of the results in Google:
I could continue to tweak and test, narrow down the time frames, and so on but there are many pages of Google results so that will keep me busy for a while.
There are many more ways to use Google Dorks for research, such as finding white papers, policy documents, scholarly research papers, or information on .gov and .edu sites. You can also use it to pull keyword specific results from industry websites, competitor sites, directories, and aggregators like Flipboard or Issuu.
Here’s another example where I find medical information from nih.gov on celiac disease. I put this into ChatGPT (after I ran the prompt):
site: nih.gov
keywords: gluten, cereal, grains
intext: “celiac disease”
num_queries: 2
Here are the 2 sets of query text I got back :
site:nih.gov intext:”celiac disease” (gluten OR cereal OR grains)
site:nih.gov intext:”celiac disease” gluten cereal grains
I put the first into Google and got this:
I hope you see the power in using AI to write these queries for you and the power of using Google in this way. Try it out. Let me know how it goes.