Key takeaways
- A ChatGPT prompt library for SEO saves time: keep your best prompts as text files and reuse them in seconds instead of retyping them.
- The Python script in this article, first published in 2023, picks a saved prompt and pastes it into the chat window using PyAutoGUI.
- For regular or larger-scale use, the official OpenAI API is the cleaner route. Check OpenAI’s terms of use for whatever method you choose.
- Faster prompting does not mean faster publishing. Google asks for all AI-generated content to be fact-checked and reviewed by a person.
- The real value is consistency: the same tested prompt every time, for briefs, titles, meta descriptions and summaries.
A ChatGPT prompt library for SEO is one of the simplest productivity wins I know. Most of us reuse the same dozen prompts every week, for content briefs, title ideas or summaries of data, and retype or copy them each time. In 2023 I wrote a small Python script to make that faster, and I still think the idea behind it is useful for anyone building AI SEO into their daily work.
I have worked in SEO and digital marketing for more than 16 years, and I am not a developer, so the script is deliberately simple. If you want the wider picture of where AI helps SEO work and where it doesn’t, read my guide to ChatGPT for SEO and working faster without cutting corners first.
I have rewritten this post to explain the script more clearly, add the limits I would now point out, and remove a price comparison with a paid tool that I could not support with a dated screenshot.
Why a prompt library helps SEO work
Good prompts take time to write and test. Once you have one that produces a useful content brief or a clean set of meta description options, you want the exact same wording every time. A prompt library gives you that:
- Consistency. The same tested instructions every time, so the output is predictable and easy to review.
- Speed. Pick a prompt by name instead of searching old chats or documents.
- Shareability. A folder of text files is easy to share with a team and to improve over time.
How the script works
The script uses PyAutoGUI, a Python library that, in its own documentation’s words, “lets your Python scripts control the mouse and keyboard to automate interactions with other applications.” It works in four steps:
- open_file(file_path) reads a saved prompt from a text file.
- search_files(query, short_names) filters your list of prompts by a search word.
- send_text(text) copies the prompt to the clipboard, waits six seconds, pastes it into the chat box with Ctrl+V and presses Enter.
- A loop lets you pick the next prompt by number, or type “search” to filter again.
Before it starts, the script clicks once on the chat box, at screen coordinates you set yourself. That is why there is a second, tiny script to find those coordinates.
The Python script
This is the script as I published it in 2023. Replace the coordinates and add your own prompt names and file paths in the short_names_original dictionary.
import os
import pyautogui
import clipboard
import time
import pyperclip
pyautogui.moveTo(replace_with_your_own_coordinates_x, replace_with_your_own_coordinates_y)
pyautogui.click()
def open_file(file_path):
with open(file_path, "r", encoding="utf-8") as f:
file_text = f.read()
return file_text
def send_text(text):
clipboard.copy(text)
time.sleep(6)
pyautogui.hotkey('ctrl', 'v')
pyautogui.press("enter")
def search_files(query, short_names):
matching_files = {}
for short_name, file_path in short_names.items():
if query.lower() in short_name.lower():
matching_files[short_name] = file_path
return matching_files
short_names_original = {
# Add your short names and their file paths here
"Short description of your chatGPT Prompt": "the full path of your saved text file of your prompt",
# ...
}
while True:
short_names = short_names_original.copy()
search_query = input("Enter a search query to filter the list of files or press Enter to skip: ")
if search_query:
short_names = search_files(search_query, short_names)
while True:
print("Select a file to send:")
for index, (short_name, file_path) in enumerate(short_names.items()):
print(f"{index + 1}. {short_name} - {os.path.basename(file_path)}")
try:
selected = input("Enter the number corresponding to the file you want to send or type 'search' to start a new search: ")
if selected.lower() == 'search':
break
else:
selected = int(selected) - 1
if 0 <= selected < len(short_names):
short_name = list(short_names.keys())[selected]
text = open_file(short_names[short_name])
send_text(text)
else:
print("Invalid selection. Try again.")
except ValueError:
print("Please enter a valid number or type 'search' to start a new search.")
Finding your screen coordinates
Save this as find_coordinates.py and run it. Hover the mouse over the chat box and note the X and Y values it prints. PyAutoGUI’s mouse functions explain that position() returns the cursor’s current coordinates and moveTo() moves the cursor to the coordinates you pass.
import pyautogui
import time
while True:
x, y = pyautogui.position()
print(f"X: {x}, Y: {y}")
time.sleep(1)
Installing the modules
I ran the scripts in the free community edition of the PyCharm IDE on Windows. Install the modules first from the command prompt:
pip install pyautogui
pip install clipboard
pip install pyperclip
python --version
python -m pip install --upgrade pip
A safety tip from PyAutoGUI’s documentation: its fail-safe is “enabled by default”. If a script misbehaves, move the mouse quickly into a corner of the main screen and PyAutoGUI stops with an exception.
Limits I would point out today
The script is a convenience for one person at one screen. If you use it, keep these points in mind.
| Approach | Good for | Watch out for |
|---|---|---|
| Copy and paste by hand | Occasional prompts | Slow, easy to use an old version of a prompt |
| This script (screen automation) | One person reusing a prompt library | Fixed screen coordinates; the service’s terms of use |
| Official OpenAI API | Regular, repeatable or team use | API key security and usage costs |
- Screen automation is fragile. If the window moves or the layout changes, the click lands in the wrong place. Keep the fail-safe on.
- Check the terms of use. OpenAI’s terms of use list what you cannot do, including to “Automatically or programmatically extract data or Output”. The script only sends prompts, but read the terms yourself and decide.
- The API is the cleaner route for scale. OpenAI’s developer quickstart shows how to send a prompt from Python through the official API, so you could send your saved prompts the same way without controlling the mouse.
Faster prompts still need human review
My 2023 post said the script helped produce content faster and more cheaply for clients. That is only half the story. Google’s guidance on generative AI content is clear: “It is critical to manually factcheck and review all AI-generated content for accuracy and trustworthiness before publishing.”
Automate the typing, never the judgement.
So the time a prompt library saves should go into review: checking facts against sources, adding real experience and examples, and deciding whether a page deserves to be published at all. Used that way, the prompts make you faster without making the work worse.
Prompts that work well in a library, in my experience: a content brief from your own research notes, five title and meta description options for a page you paste in, a plain-English summary of a Search Console export, a first draft of FAQ questions from customer emails, and a checklist review of a draft against your style guide.
FAQ
What is a ChatGPT prompt library for SEO?
A collection of tested prompts, saved as files or notes, that you reuse for recurring SEO tasks such as content briefs, titles, meta descriptions and data summaries. It keeps the wording consistent and saves retyping.
Can I send ChatGPT prompts from a file without the API?
The script in this article does it by pasting the file’s text into the chat window with PyAutoGUI. It is fragile and suited to one person; for regular use, the official OpenAI API is the cleaner option. Check OpenAI’s terms of use either way.
What does PyAutoGUI do?
It is a Python library that lets scripts control the mouse and keyboard. Its fail-safe is on by default: moving the mouse into a corner of the main screen stops the script.
Do I still need to review content produced with these prompts?
Yes. Google asks site owners to manually fact-check and review all AI-generated content for accuracy and trustworthiness before publishing.