Blog / Build with AI /
Building a title and meta description checker with AI
Every site audit I’ve seen has the same boring finding: titles that are too long, meta descriptions that are missing, and the same title on forty pages. Checking them by hand is slow, and the big crawling tools are more than you need for a 30-page site.
So here’s a small project. A single web page where you paste in your titles and descriptions, and it tells you which ones are too short, too long, missing or duplicated. It needs no server and no libraries, and ChatGPT can draft most of it in one go.
The aim of the post isn’t just the tool. It’s how to ask for it, how to read what comes back, and where it will quietly mislead you.
What the finished thing does
You paste rows like this into a text box, one per line:
Page URL | Title | Meta description
Then click “Check”. The page shows a table with:
- Title length in characters, flagged if it’s empty or over a limit.
- Description length, flagged the same way.
- A warning when two pages share a title or description.
That’s a useful first look at a small site, and it’s a tidy first project.
Know the rules you’re coding
Before prompting, decide what “too long” means. Search engines don’t publish a hard character limit for titles and descriptions. Google truncates by pixel width, which depends on the letters used, and it often rewrites titles and descriptions anyway. So character counts are a rule of thumb, not a law.
Commonly used guidance is around 50 to 60 characters for titles and around 150 to 160 for descriptions. Treat these as defaults, and make them editable in your tool. That’s an honest design: the tool shows a signal, and you make the call. I went deeper on the title side in title tags that get clicks without overpromising.
Step 1: the prompt
Be specific about the platform, the inputs and the outputs:
Build a single HTML file with CSS and JavaScript, no external libraries. A textarea accepts lines in the format “URL | Title | Meta description”. A button labelled Check parses the lines and shows a table with columns: URL, Title length, Description length, Issues. Flag a title that is empty or longer than a number I can change (default 60), and a description that is empty or longer than a number I can change (default 160). Flag duplicates of titles and descriptions across rows. Handle blank lines and lines with missing parts without crashing. Add comments explaining each function.
Notice the details: the input format, the editable thresholds, the edge cases (blank lines, missing parts) and the request for comments. Edge cases mentioned up front save you a round of bug fixes later.
Step 2: what the code should contain
You don’t need to write it, but you should recognise the pieces:
- Read the textarea and split the text into lines.
- Split each line on the
|character and trim the spaces. - Count characters with
.length. - Track duplicates using a simple object that counts how many times each title appears.
- Build the table and add a flag message for each problem.
Here’s what the counting-and-duplicates core might look like:
const counts = {};
rows.forEach(r => {
const key = r.title.toLowerCase();
counts[key] = (counts[key] || 0) + 1;
});
rows.forEach(r => {
const issues = [];
if (!r.title) issues.push("Missing title");
else if (r.title.length > maxTitle) issues.push("Title too long");
if (r.title && counts[r.title.toLowerCase()] > 1) issues.push("Duplicate title");
r.issues = issues;
});
The first loop counts titles; the second reads those counts to flag duplicates. If your generated version looks quite different, that’s fine, but you should be able to find these ideas in it.
Step 3: test it properly
A checker that gives wrong answers is worse than none. Test with a deliberate mix:
| Test row | Expected result |
|---|---|
| A normal title and description | No issues |
| An empty title | “Missing title” |
| A 90-character title | “Title too long” |
| Two rows with the same title | Both flagged as duplicate |
| Same title, different capital letters | Flagged as duplicate |
| A line with only a URL | Doesn’t crash; flags both as missing |
A title containing the | character |
See below |
That last one is a real trap. If a page title contains a pipe (common: “Shoes | My Store”), splitting on | breaks the row. Either change the separator to a tab (which is what you get when you copy cells from a spreadsheet) or tell the tool to treat the first and last separators specially. Ask the AI:
My titles can contain the pipe character. Change the input to tab-separated, so I can paste straight from a spreadsheet.
Step 4: improvements worth asking for
Once the basics work, add one thing at a time:
- A “copy results” button to paste the table into a document.
- Highlighted cells with colour as well as text, so it’s readable at a glance.
- A check for the brand name at the end of titles, if you use that pattern.
- Counting words as well as characters.
- Fetching titles from a URL list. This one is harder: a browser page can’t freely fetch other sites because of security rules (CORS), so you’d need a small back end or a crawler export. Better to paste data from a crawl or CMS export.
Where it will mislead you
- Character counts are not pixel widths. A title full of capital letters or wide characters can be cut off at fewer characters than one full of narrow letters.
- Google rewrites titles. A “perfect” title may still show differently.
- Duplicate doesn’t always mean bad. Paginated pages or deliberate variants might legitimately share a pattern.
- It can’t judge quality. It can’t tell you if a title is useful or a description is persuasive. It only catches the mechanical issues.
I’d rather say that plainly than let a green tick make anyone feel their SEO is done.
Next step
Once it works, put it somewhere safe, such as a folder on your computer or a page on your own site, and use it on your next audit. Then try the tool on a WordPress export or a crawl and note what it missed. That list of misses is your next prompt. If you want a refresher on building small tools in general, building a tiny tool with AI, from idea to working page in an afternoon covers the overall method.
Key takeaways
- A small paste-in checker is a good first AI-built SEO tool.
- Put thresholds in the interface; they’re guidance, not law.
- Test duplicates, blanks and awkward characters like pipes.
- The tool catches mechanical problems, not quality.
Related reading
- Building a meal planner with AI
- Building a colour palette tool with AI
- Building a reading level checker for your writing with AI
What would you want it to check next: heading structure, image alt text, or something I haven’t thought of?