DEV Community

TechFocus
TechFocus

Posted on

The Permalink Mistake That Quietly Broke 100+ Internal Links on My Site

I run TechFocus360, a small SEO agency site with about 100 blog posts spread across 10 categories. Recently, while doing a technical audit before launch, I found a problem that taught me more about WordPress URL structure than any tutorial ever did.

Here's what happened, what I got wrong, and how I fixed it.

The Problem: URLs Way Longer Than They Should Be

My permalink structure was set to /%category%/%postname%/ — which seemed fine, until I looked at the resulting URLs:

techfocus360.com/blogs/artificial-intelligence-machine-learning/future-of-artificial-intelligence/

That's 106 characters. The actual post slug is only 35 characters — the rest was just the category name dumped straight into the URL. Multiply that across 10 categories (some names even longer, like software-development-coding-dev-tools), and every one of my 100 posts had unnecessarily bloated URLs.

My First Fix Was Wrong

My instinct: remove %category% from the structure entirely, down to /blogs/%postname%/. Clean, short, simple.

Big mistake. Within minutes, my tool pages (also organized as WordPress categories — I didn't realise this mattered) started 404ing, category archives broke, and breadcrumbs rendered nonsense like Home > Blogs > Blogs > Category.

Lesson: if a permalink change affects %category%, it affects every content type using that taxonomy — not just the one you're thinking about. I reverted immediately.

The Actual Fix: Shorten the Slug, Not the Structure

WordPress separates a category's display name from its URL slug — you can change one without touching the other. So instead of touching the permalink structure, I just edited each category's slug:

Category (name unchanged) Old slug New slug
Artificial Intelligence & Machine Learning artificial-intelligence-machine-learning ai-ml
Software Development, Coding & Dev Tools software-development-coding-dev-tools dev-tools
Cybersecurity, Data Privacy & Online Safety cybersecurity-data-privacy-online-safety cybersecurity

Same structure, same tool pages, same breadcrumbs — URLs dropped from 100+ characters to under 60. Nothing else broke.

The Part I Didn't See Coming

Changing a category slug doesn't just change future URLs — it silently breaks every link already hardcoded with the old slug. And a lot of my posts linked to each other, similar to what I write about in my internal linking guide. Every one of those links had the old, long slug baked into the href, written when the post was created.

I found this auditing internal links post by post — nearly every article had at least one link pointing to a category slug renamed weeks earlier. Multiply that by 100 posts, and you get a lot of quietly broken internal links.

Two Ways to Fix This

1. Redirects (fast, non-destructive) — a rule like contains: /blogs/old-slug/ → /blogs/new-slug/ catches everything, including anything Google already indexed, without touching content.

2. Direct database search-and-replace (permanent) — using something like Better Search Replace, search your wp_posts table for the old slug fragment and replace it across every post in one operation (always dry-run first).

I did both: redirects for immediate safety, and manually fixing internal links over time as I reviewed that content anyway — the same process I now run as part of a full technical SEO audit for client sites.

The Takeaway

If your site organises any content type by category and you're tempted to "clean up" your URL structure, ask two questions first: is the permalink structure actually the problem, or just one slug that's too long? And what other content types share that same taxonomy?

The fix that worked was smaller and safer than the one I tried first — and the invisible cost (broken internal links across 100 posts) was bigger than the problem I set out to solve. Cheap lesson in hindsight.


I write about SEO, site architecture, and the practical side of running a small SaaS-focused agency at TechFocus360. If you've had a similar "small change, big blast radius" moment, I'd like to hear about it.

Top comments (1)

Collapse
 
alexshev profile image
Alex Shev

The local version of this problem is often operational, not just SEO. A site should expose the facts that determine whether a customer can act now—service scope, area, hours, contact path, and real work evidence.