If you run a WordPress site, you've probably faced the 404 headache. Maybe you migrated your content, updated your permalinks, or pruned old posts. Suddenly, search engines start reporting broken links, and your visitors hit dead ends.
While manual redirection plugins exist, they quickly become a chore when you are dealing with dozens or hundreds of broken URLs. That is why I built FixLinks: a WordPress plugin designed to scan your site's 404 errors and automatically suggest the most relevant 301 redirect targets using the Gemini API.
Who Benefits Most?
I built this tool with a few specific user profiles in mind:
The Long-Term Blogger & Content Publisher
If you have run a blog for five years, you have likely restructured your categories or updated older articles multiple times. Tracking down every dead link that external sites point to is nearly impossible. FixLinks helps you preserve the search engine authority (link equity) those old posts built up over time by finding the closest modern equivalent on your current site.The SEO Consultant and Agency Manager
Managing SEO for clients means constantly looking at audit reports. Cleaning up 404 errors on a large ecommerce site or content hub is tedious work. Instead of manually mapping spreadsheet rows of old URLs to new ones, consultants can run a scan, review AI-generated suggestions, and approve them in bulk.The Web Developer Handing Off Sites
When developers hand over a migrated site to a client, links often break post-launch. Rather than writing complex redirection rules in.htaccessor Nginx configs—which clients can easily break—developers can set up this plugin so clients can manage redirects themselves using a simple interface.
The Tech Stack
The architecture is split into two main components:
- The WordPress Plugin (PHP & Javascript): A lightweight client that hooks into WordPress's template redirect engine to catch 404 events, logs them, and exposes a clean React-based admin dashboard.
- The Redirect Matching Engine (Node.js & Gemini API): A serverless microservice that takes your active 404 path list, compares it against your public sitemap or published page index, and queries Gemini. We use the Gemini API's structured JSON output format to ensure we receive clean arrays of suggestions containing the source path, suggested destination, and a confidence score.
Technical Challenges
The biggest challenge was semantic matching without burning API tokens.
Simply sending every single 404 path to the LLM individually is slow and expensive. To solve this, we implemented a multi-tiered filtering system:
- Sitemap Indexing: The plugin indexes all valid published URLs and keeps a lightweight local cache.
- String Similarity Pre-filtering: We use a quick Jaro-Winkler distance calculation to handle simple typos or URL changes locally.
-
LLM Batching: If local heuristics fail to find a high-confidence match, the remaining paths are batched and sent to Gemini. The model is prompted to map ambiguous paths (e.g.,
/get-in-touchvs./contact-us-now) by understanding the semantic intent behind the URL slugs.
Lessons Learned
One of the most important takeaways from building this was the necessity of a human-in-the-loop design.
In early prototypes, I experimented with fully automated redirects. If a 404 occurred, the plugin would automatically map and redirect the user on the fly. However, this occasionally created redirect loops or mapped irrelevant pages, leading to a confusing user experience. I quickly realized that AI should act as an assistant, not an autonomous driver. The current iteration presents the mapped suggestions in a dashboard, allowing the site owner to review and apply them with one click.
Try It Out
If you are tired of manually mapping broken links or looking to restore lost search rankings, you can find the plugin and try it out at https://fixlinks.getinfotoyou.com.
I'd love to hear your feedback on the matching accuracy and any features you would like to see added.
Top comments (0)