How We Fixed 1,000+ “Discovered – Not Indexed” Pages Overnight
How We Fixed 1,000+ “Discovered – Not Indexed” Pages Overnight
For months, Google Search Console was showing over a thousand pages stuck as “Discovered – not currently indexed.”
Crawl budget was fine. Sitemap was fine. Robots.txt fine.
So what the hell was happening?
Turns out, our URLs were garbage — every tutorial lived under a numeric ID:
/view/12345
No topic, no context, no reason for Google to care.
From the crawler’s perspective, it looked like an endless database dump.
So we rebuilt the entire system.
🔧 The Fix
- Added a proper slug column to the database:
ALTER TABLE lessons ADD COLUMN url_slug VARCHAR(255) AFTER id;
UPDATE lessons
SET url_slug = CONCAT(
LEFT(
LOWER(
TRIM(
REGEXP_REPLACE(
REPLACE(REPLACE(REPLACE(title, ' ', '-'), '?', ''), '/', '-'),
'[^a-z0-9-]+', ''
)
)
), 60
),
'-', id
);
-
Changed the Flask route from
/view/<int:id>
→/tutorials/<slug>/
. -
Added a 301 redirect route so every old link still works:
@app.route("/view/<int:item_id>")
def legacy_redirect(item_id):
record = db_get("SELECT url_slug FROM lessons WHERE id = %s", (item_id,))
if not record:
abort(404)
return redirect(url_for("show_tutorial", slug=record["url_slug"]), 301)
- Regenerated the sitemap and requested a recrawl in Google Search Console.
⚡ The Results
Within a week, crawl rate spiked and the “Discovered – not indexed” count started dropping fast.
New pages now get indexed in days, not months.
And users get cleaner URLs they actually understand.
It’s one of those unglamorous backend jobs that makes a real difference — better for SEO, better for humans, and easier to maintain long-term.
Next up: internal link mapping so tutorials auto-connect to related topics without manual tagging.