Guide

How to find and update redirected links in WordPress

A redirected link still works, so it's easy to ignore. But every redirect adds a round trip for the visitor, chains of them slow pages down, and some quietly end on a different page than the one you meant. Here's how to find them and when it's worth updating them.

Where redirected links come from

  • http to https: posts written before the switch still link to http:// addresses.
  • Changed permalinks: you renamed a post or changed the permalink structure, and WordPress or a plugin redirects the old address.
  • www or no www: links use the version of the domain that isn't the main one.
  • Other sites moved: an external page you linked to now lives at a new address, or now sends everyone to a home page.

Which ones to fix first

  1. Internal links that redirect. These are fully in your control and fixing them is quick. They also make sure search engines see your real addresses.
  2. Redirect chains (A to B to C). Each step adds delay, and long chains may not be followed to the end.
  3. External links that redirect to a home page. Usually the page you linked to is gone. Treat these as broken: find a new source or remove the link.
  4. External links that redirect to the same content at a new address. Low priority, but easy to update when you're editing the post anyway.

Check one link in your browser

Open the developer tools (F12), go to the Network tab, tick Preserve log and open the link. Each redirect shows as a line with status 301 or 302, followed by the final page with 200. The address of that last line is the one to use. From a terminal, curl -sIL https://example.com/old-page/ shows the same chain.

Find every redirected link on your site

The free Hrefix plugin checks the links and image addresses in your published content on your own server and labels each one as working, broken, redirect or warning.

  1. Install and activate Hrefix, then go to Tools > Hrefix and click Start link checking.
  2. When the check has run, set the status filter to Redirects.
  3. Each link shows Redirects to: with the address it ends up on. If that's the page you meant, use Edit to replace the link with it. Hrefix changes the address in the post itself, so you don't have to open the editor. If it ends on a home page or an unrelated page, treat the link as broken.
  4. Click Recheck to confirm the link now goes straight to its target.

Fixing many at once

If hundreds of links share one pattern, such as http://yoursite.com, a single search and replace is faster than editing them one by one. Use WP-CLI's wp search-replace 'http://yoursite.com' 'https://yoursite.com' --dry-run or a plugin such as Better Search Replace. Take a backup first and look at the dry run before you change anything. Then run a new link check to catch the rest.

Keep the redirects in place

Updating your links doesn't mean removing the redirects. Other sites, bookmarks and search results still use the old addresses. Keep server or plugin redirects for anything that was ever public. See how to fix 404 errors with 301 redirects.

Want this done inside WordPress? Hrefix is a free plugin that finds broken links on your own site, with no account and no cloud service. Hrefix Pro (from €39 per year) adds a 404 monitor, a bulk redirect fixer and a weekly email report.