Link Canary – Find and Fix Broken Links

By Takashi Fujisaki

0+ active installationsVersion 1.5.0

Find and fix broken links. 100% local processing — no cloud service, no account required, no link limits.

Description

Link Canary finds broken links across your entire site and helps you fix them in bulk — without ever talking to a third-party service.

Everything runs on your server. The only outgoing requests Link Canary makes are the checks against the links themselves. There is no cloud dashboard, no account signup, no credit card, and no monthly link quota. Check ten links or a hundred thousand — it is your server, your data, your call.

What gets scanned

Link Canary scans the content and custom fields of every published post in every public post type. Because it walks post meta too, all of the following are covered automatically:

  • Posts, pages, and custom post types
  • Navigation menu items
  • Block theme navigation, template parts (headers/footers), and synced patterns
  • Links stored in custom fields (including serialized data such as ACF repeaters)

Post types registered as private are left alone, so data that never reaches your visitors — contact form submissions, shop orders, field definitions — is not read.

Careful checking

  • External links are checked over HTTP with redirects followed. Temporary failures — timeouts, DNS errors, server errors — must repeat several times before a link is called broken, so an outage never triggers a false alarm; a server answering 404 or 410 is reported straight away.
  • Internal links are resolved against your own database and filesystem — no self-inflicted HTTP traffic, no loopback issues on shared hosting.
  • Another site on your domain — a second WordPress in a subfolder, say, or anything outside the folder your site is installed in — is checked over HTTP like an external link, because your database knows nothing about its pages. If your server cannot reach itself, those links stay at “Needs review” instead of being reported broken.
  • Consecutive requests to the same host are rate-limited (configurable) to stay polite to other people’s servers.
  • Nothing is sent to private or local addresses or to unusual ports, so a link in a post cannot be used to probe the inside of your network. Those links stay at “Needs review”.
  • Healthy links are skipped for a configurable number of days; broken links are rechecked on every scan so recoveries are noticed.
  • When a link is reported broken but works in your browser, mark it “It works for me”. It stops counting as broken while still being checked on every scan, and the mark clears itself the moment the link answers normally again.
  • Hosts that refuse bots (401, 403, 429, 503) are filed separately as “Blocked by host” instead of being called broken. Those links work for your readers, so they stay out of the way — and out of your email — while still being rechecked.

Fixing links

  • Replace a URL everywhere it appears — with a mandatory dry-run preview showing every affected post and field before anything is written.
  • Remove the link instead: the text stays exactly where it is, only the surrounding link tag goes. Same mandatory preview, showing the markup that disappears and the text that survives.
  • Replacements go through the WordPress APIs (wp_update_post() / update_post_meta()), so serialized data is never corrupted.
  • Export the link list as CSV — one row for every place a link is used, with the post, the link text, and a link to the editor — to hand the fixes to whoever edits your posts.
  • Every replacement and removal is recorded in a history you can export as CSV.
  • Where post revisions are enabled, they act as an additional safety net for post content (revisions do not cover custom fields).

Notifications

Scheduled scans start with your first manual check (once a day) or when you pick a frequency in Settings, and can be turned off at any time. They email you when — and only when — new broken links are found. Manual scans never send email, and the same broken link is not reported again on every scan.

Source code

The JavaScript and CSS in build/ are generated from the readable files in src/, which ship with the plugin together with package.json and webpack.config.js. To rebuild them, run pnpm install and pnpm build in the plugin folder.

What Link Canary does not do

  • No cloud scanning, no external accounts, no paid limits.
  • Single site only — multisite network activation is not supported.
  • Comments and classic widgets are not scanned in this version.

Installation

  1. Upload the plugin files to /wp-content/plugins/link-canary/, or install through the WordPress plugins screen.
  2. Activate the plugin.
  3. Go to Link Canary in the admin menu and press Check Now. Nothing is checked before that. The first check also turns on a daily scheduled scan; change how often it runs, or turn it off, in Link Canary → Settings.

FAQ

Does this send my data anywhere?

No. The only outgoing traffic is the HTTP requests to the links being checked, and none are sent until you press Check Now or turn scheduled scans on in Settings. Unless you switch the User-Agent setting to browser mode, those requests carry your site’s address so that the other site can tell who is checking. Nothing is ever sent to the plugin author or any third-party service.

Why is a link marked “Needs review”?

Either it has started failing but has not yet crossed the failure threshold, or it is an internal URL that cannot be resolved to a post, archive or file (a feed, a search result or the second page of an archive, for example), or it points at another site on your domain that your server could not reach over HTTP. Needs-review links are never counted as broken.

Why is a link marked “Blocked by host”?

The server turned the request away instead of saying the page is gone — 401, 403, 429 or 503. Sites like Amazon, Unsplash and npm do this to anything that is not a real browser, while serving the same page perfectly well to your readers. Those links are almost never broken, and no amount of editing the post would change the answer, so they are kept out of the broken list and given their own tab. They are still checked on every scan, so if one of them starts working again it moves back to OK by itself. Switching the User-Agent setting to browser mode clears most of them.

A link is reported broken, but it opens fine in my browser.

A few sites answer real browsers and automated checks differently, and no setting can fully close that gap. Apple’s storefronts are the clearest case: an old music.apple.com catalog URL can show the album perfectly in a browser while every automated request — including Apple’s own lookup API — is told 404.

Press It works for me on that row. The link moves to the “Works for you” tab, stops counting as broken and stops appearing in notification emails, but — unlike ignoring — it is still checked on every scan. If it ever starts answering normally the mark clears itself and the row goes back to OK, and if you later decide you were wrong, “Not verified after all” sends it back for review. The status badge remembers the date you confirmed it.

Replacing the link with its current URL is still worth doing when you next edit the post, since search engine crawlers are told the same 404 the checker was.

What is the difference between “Ignore” and “It works for me”?

Ignoring stops the checking entirely: the URL is skipped by every scan and frozen at whatever status it had. Use it for links you have decided not to think about again.

“It works for me” keeps the checking going and only changes how a repeated failure is reported. Use it when the link genuinely works and the checker is the one getting it wrong — you keep the safety net for the day the link really does break.

Can I undo a replacement?

There is no one-click undo. Every replacement is recorded in the History screen, so you can run the replacement in the opposite direction. On sites where revisions are enabled, post content (not custom fields) can also be restored from a revision.

What exactly does “Remove link” do?

It deletes the link tag around a URL and leaves the text it wrapped in place, so a dead link becomes plain text instead of vanishing. A link wrapping an image keeps the image. Locations with no link tag to unwrap — an image source, a plain URL stored in a custom field, a menu item URL — are reported as having nothing to remove and are left untouched. The same goes for the links of Button and File blocks: the link is what those blocks are made of, so taking it out would leave a broken block. Change those in the block itself. Removals are listed in the History screen; there is no automatic undo, so revisions are the way back for post content.

Are contact form submissions and shop orders scanned?

No. Only public post types are scanned, and form plugins store submitted messages in a private post type, as do shops for their orders. Because every post is read together with all of its custom fields, scanning those would mean reading the body of every message people have sent you — so Link Canary skips them outright. The core post types that are private but still render on the front end (synced patterns, navigation, template parts, menu items) remain covered. If a private post type of your own does output links to visitors, add it with the link_canary_scanned_post_types filter.

Does it work on multisite?

No. Link Canary is single-site only. Network activation is blocked; activating it on an individual site within a network works.

Will it slow down my site?

Scans run in short time-boxed batches through WP-Cron and resume where they left off, so they behave well even on shared hosting with strict execution limits.

It says scheduled scans are not running. What now?

WP-Cron is not a real cron: WordPress starts it by calling your own site over HTTP, and plenty of hosts block that. Once the schedule is more than two hours behind, Link Canary says so on its own screens rather than letting you believe your links are still being watched. Tools → Site Health reports whether those loopback requests are the problem. If your site defines the DISABLE_WP_CRON constant, a task scheduler on your server has to call wp-cron.php instead — check that it is set up and still running. Checks you start yourself from the Broken Links screen work either way.

Screenshots

Changelog

1.5.0

  • Change: Activating the plugin no longer schedules a scan on its own. Scheduled scans start with your first “Check Now” or when you choose a frequency in Settings, where they can now also be turned off. Sites that were already using the plugin keep their schedule.
  • New: “Export CSV” on the link list downloads every link matching the current tab and filters, across all pages, with one row for every place a link is used: its status, code and last check, the post, post type and location, the link text, and links to the editor and the published page. Hand it to whoever edits your posts. The file opens in Excel without garbled characters.
  • Fix: A post title crafted with backslashes and quotes could break out of its cell in the fix history CSV and be read by a spreadsheet as a formula. Cells are now quoted the standard way, so every value stays in its own cell as text.
  • Fix: Links in block theme navigation, social icons and other blocks that keep their URL in the block’s settings instead of its markup were not scanned at all. They are collected now, and “Fix URL” can change them.
  • Fix: In custom fields that store JSON (page builders, mostly), “Fix URL” also rewrote the beginning of any longer URL starting with the one being fixed — fixing /docs turned /docs/install into something else. Only the exact URL is replaced now.
  • Fix: “Fix URL” changed a URL containing & or — in the block’s markup but not in the block’s own settings, so the block failed validation in the editor. Both change together now.
  • Fix: Custom fields holding data that a plugin serialized itself were left unreadable by “Fix URL” and “Remove link” whenever the length of the text changed. They are rewritten safely now.
  • Fix: Fixing a link in a custom field that holds an object removed the backslashes from every other text in that field. Custom fields containing data from a deactivated plugin are now left alone instead of ending the request with an error.
  • Fix: “Remove link” took the link out of Button and File blocks, which left broken blocks behind. Those links now stay, and the preview says to change them in the block.
  • Fix: When a batch ran long, WP-Cron and the open Broken Links screen could work through the same batch at the same time, requesting every URL twice. “Reset scan data” pressed during a scan could also bring that scan back to life. Neither happens now.
  • Fix: A scan that ran out of memory while collecting links started over from the same posts every time and never got past them. Collecting uses far less memory, and progress is saved as it goes.
  • Fix: URLs stored in JSON custom fields were cut off at their first Japanese (or other non-ASCII) character and checked as a different, shorter URL. They are read in full now, and “Fix URL” can change them.
  • Fix: On a site installed in a subdirectory, links to its own front page stayed in “Needs review” forever. Links to your own uploads written with http:// on an https site, or with a different www., did too. Both are resolved now.
  • Fix: A link to another port of your own domain is no longer mistaken for a page of this site.
  • Fix: For users who may not save unfiltered HTML, “Fix URL” and “Remove link” could strip markup from a post’s title or excerpt on the way. Such posts are now left alone and marked in the preview, as posts whose content would be affected already were.
  • Fix: “Remove link” on a link tag that was never closed no longer breaks the link after it.
  • Fix: Deleting a post now takes the URLs only that post used out of the list straight away. A scan that takes longer than a day is no longer abandoned while it is still making progress, and a database error while collecting no longer discards the links of posts the scan had not reached.
  • Fix: An invalid notification email was saved as empty without a word, sending notifications to the site admin instead. It is now rejected with a notice and the previous address is kept. Excluded domains written as a URL, with a port or with a leading wildcard are understood instead of silently matching nothing.
  • Fix: The fix history CSV opens in Excel without garbled characters and no longer needs to hold the whole history in memory. The history screen no longer calls a post deleted when only its post type is gone.
  • Fix: The date on the “Works for you” badge could be a day early in time zones ahead of UTC.
  • Fix: On the Broken Links screen: a page number past the last page shows the last page instead of an empty table; “Show N more” says when not everything fits; pressing “Check Now” while a scan is already running follows that scan instead of reporting an error; a preview that arrives late no longer shows up under another URL; applying a fix that changes nothing says so instead of “Replacements applied”; and the Fix URL dialog keeps keyboard focus inside it and gives it back when it closes.
  • Fix: Uninstalling the plugin while keeping its data now still removes its scheduled events.
  • Change: Checks are no longer sent to private or local addresses (127.0.0.1, 192.168.x.x, a bare host name such as localhost) or to ports other than 80, 443 and 8080. Those links stay at “Needs review” and say “Not checked”. Anyone who can publish a post can write a URL, and without this the checker could be used to probe the inside of your network. An intranet can allow its hosts and ports with the core filters http_request_host_is_external and http_allowed_safe_ports.
  • Change: “Fix URL” and “Remove link” now also ask whether your account may edit each post. Posts you may not edit are listed in the preview but cannot be selected. Nothing changes for administrators.
  • Change: An upload that is missing from the server but still listed in the media library is reported as “Needs review” instead of broken, so sites that move their media to external storage no longer see every image flagged.
  • Change: When a domain name does not resolve, the check stops there instead of trying a second request, which makes scans of sites with many dead domains noticeably faster.
  • Fix: Until a check frequency had been chosen, the Settings screen showed “Off” as selected, and saving any other setting quietly made it the choice. The screen now says “Not chosen yet” and leaves it that way.
  • Fix: A scheduled scan whose batch died part-way — a timeout, an out-of-memory error — stayed stopped until somebody opened the Broken Links screen. It now picks itself up again after a few minutes. A database error while checking no longer ends the scan early as if it were finished.

1.4.0

  • New: The list opens on a “Needs attention” tab that gathers broken, needs-review and unchecked links in that order. Before, it opened on “Broken”, and an empty tab looked like a clean site while other links were still waiting in other tabs. “Blocked by host” stays in its own tab; when it still holds links, the empty view says how many and links to it.
  • New: A “Used in” column shows where each link appears without expanding the row — the post title (opening the editor), its post type, the meta key for links stored in custom fields, the link text, and “See in context”, which opens the published page scrolled to the link in browsers that support text fragments. Links used in more than one place list the rest on demand.
  • New: A Settings link on the Plugins screen.
  • Fix: Links to post type archives such as /events/ and to category, tag and other term archives stayed in “Needs review” forever. The first page of an existing archive is now OK.
  • Fix: Links to the posts page (Settings → Reading) stayed in “Needs review” forever. They are now OK.
  • Fix: Links to another site on the same domain — a separate WordPress or static site in a subdirectory — were treated as internal and stayed in “Needs review”. They are now checked over HTTP like any external link. A connection failure there never counts as broken, since some hosts cannot reach themselves.
  • Fix: On a site installed in a subdirectory, root-relative links such as /page were checked against the wrong address. They now resolve the way a browser does.
  • Fix: Links that redirect more than five times were reported as broken. Up to 20 redirects are followed now, as browsers do, and a longer chain says “Too many redirects”.
  • Fix: “Fix URL” missed links written as relative URLs (/page or //example.com/page). It now replaces them and keeps them relative.
  • Fix: “Fix URL” treated $ and \ in the new URL as regex references, which could garble the post. The new URL is now inserted exactly as typed.
  • Fix: Saving the settings showed no confirmation.
  • Fix: When a request on the list screen fails, the notice now says what failed and what to try next, and failures that used to stop silently are reported.
  • Fix: The User-Agent sent with checks now carries the current version.

1.3.0

  • New: “It works for me” marks a link you have confirmed in your browser. It stops counting as broken and stops being emailed, but keeps being checked on every scan — so unlike ignoring, you still find out if it breaks for real. The mark clears itself if the link starts answering normally, and the badge remembers the date you confirmed it. Available as a row action and a bulk action, with its own tab.
  • Fix: Links filed as “Blocked by host” in 1.1.0 were left out of the recheck rotation, so they never recovered on their own. They are checked every scan again.

1.2.0

  • New: When no HTTP response comes back at all, the status column now names the reason — Domain not found, DNS failure, Timeout, TLS error, or Connection failed — instead of showing a dash. A vanished domain means the link needs fixing; a timeout or TLS error means the check could not get through and the post itself may be fine. The dash hid that difference.
  • Change: A domain the resolver explicitly reports as nonexistent is marked broken immediately instead of waiting out the retry budget. Ambiguous resolver failures still get the usual retries.

1.1.0

  • New: Links refused by the host — 401, 403, 429 or 503 — are filed as “Blocked by host” instead of broken, with their own tab. Amazon, Unsplash, npm and others turn away anything that is not a browser while serving your readers normally, and on a site with affiliate links those responses could bury every real failure. Blocked links are still rechecked on every scan and return to OK on their own, and they are never emailed to you.

1.0.5

  • Fix: Full-width punctuation stuck to the end of a URL is no longer read as part of the address. Writing (https://example.com/) in Japanese text left the closing bracket attached, and the link was reported as broken. Kana and kanji are left alone, so URLs that legitimately contain Japanese still work.
  • Fix: A closing parenthesis that belongs to the address is kept. URLs such as /wiki/Bar_(disambiguation) and Apple’s documentation links ending in (_:ordered:) were being cut short and reported as broken.

1.0.4

  • Fix: In browser mode, checks now send the Accept and Accept-Language headers a browser would send. A browser User-Agent alone was not enough for every bot filter — some storefronts answer 404 without them — so live pages were reported as broken. Accept-Language follows your site language.

1.0.3

  • Fix: Pages that turn away HEAD requests are no longer reported as broken. Google Support, the Visual Studio Marketplace and a number of other sites answer HEAD with 404 while serving the very same page to a browser, so those links were flagged forever with nothing to fix. A failing HEAD is now confirmed with a GET before anything is called broken.

1.0.2

  • Fix: XML namespace declarations are no longer reported as links. Inline SVG carries xmlns=”http://www.w3.org/2000/svg”, and because w3.org turns bots away, that identifier showed up as a warning no amount of editing could clear.

1.0.1

  • Fix: Scans no longer walk post types that are registered as private — form submissions, oEmbed caches, and orphaned data left behind by removed plugins. None of it reaches your readers, and on a site with a contact form it can account for nearly half of everything reported. Non-public core types that do render links (reusable blocks, navigation, templates, menu items) are still scanned.

1.0.0

  • Initial release.