HrefHub

By Keshab Adhikari

0+ active installationsVersion 1.9.0

Every link on your site in one table. Change a URL once and it changes in all 47 places it appears — with a preview before and an undo after.

Description

You changed a URL. Now it is wrong in forty-seven posts and you have no list of
which ones.

Broken link plugins tell you what is broken. Search-and-replace plugins swap a
string across your database and hope. Neither of them shows you what you actually
have. HrefHub is the link inventory: every link on the site, grouped by
where it points, with the number of places it appears and what happens when you
follow it.

Then it lets you change one of them everywhere, in one action.

What it does

  • Lists every link found in post content and Gutenberg blocks, grouped by destination URL
  • Shows how many places each URL appears, and which posts they are
  • Checks HTTP status and counts the redirect chain, so “three redirects” reads differently from “404”
  • Filters by status, internal or external, and post type; search by address, site name or anchor text
  • Changes a URL everywhere it appears, with a confirmation preview first
  • One-step undo of the last change
  • Bulk action: replace every redirecting URL with its final destination
  • Bulk action: remove or change links, reviewing every paragraph first — keep the words, drop them, point the link somewhere new, or rewrite the sentence
  • Mark a link as working when the checker is blocked but it opens fine in your browser
  • CSV export of whatever you are currently looking at
  • A printable fix report (save it as PDF) of every change made, for any date range

The one that saves an afternoon

Sites accumulate redirects. A link you added three years ago now goes through two
or three hops before it lands. Filter to Redirects and click Replace safe redirects:
every link that only went from http to https, or gained or lost www or a slash, is rewritten
to point straight at where it already ends up — and one Undo puts them all back. Redirects to
a moved page or another website are fixed one by one: choose Use redirect destination from
a link’s menu to see the posts first.

Cleaning up dead links without breaking sentences

Removing a dead link sounds simple until the link text was “click here”. Tick the
links, choose Remove or change links (review first), and HrefHub shows every paragraph
that uses them. For each one: keep the words, drop them, point the link at a new URL,
or rewrite the sentence.
Nothing changes until you choose, links like “here” and “read more” are flagged for
rewording, and the whole run can be undone.

What gets scanned

This version reads:

  • All public post types, plus reusable blocks — untick any you do not want under HrefHub → Settings
  • post_content HTML anchors
  • Gutenberg block attributes — button URLs, image links, cover backgrounds and so on

This version does not read links stored by page builders (Elementor), custom
field plugins (ACF), navigation menus, widgets, theme options or FSE templates.
They are not listed and they are not changed. The admin screen states this too,
so you always know what the numbers cover.

Pages built with Elementor, Beaver Builder or Bricks are skipped as a whole. The
builder displays them from its own data, and the copy it leaves in post content
is not what visitors see, so changing links there would change nothing. The admin
screen shows how many were skipped.

Careful by default

This plugin edits your content, so it is built to be boring about it:

  • A preview before every write, showing exactly how many occurrences in how many posts
  • A snapshot of every post before it is touched, and a one-click undo
  • The version before each change is saved in the post’s Revisions, as a second safety net
  • Redirects are never followed into a risky destination (another website, a domain-for-sale page or a flagged site)
  • No link is called broken until it has failed twice — 403, 429 and 503 get a “needs review” state instead, because a bot filter is not a dead link
  • When a bot filter refuses the quick check, it is asked once more the way a browser would (a normal page request with browser headers), so fewer working links land in “needs review”
  • Removing links never changes a paragraph you did not choose: each one starts as “Leave as is”
  • Your own site’s links are resolved internally rather than fetched over HTTP, which is faster and avoids loopback stalls
  • Scanning runs in small batches, so it finishes on managed hosts that kill long requests

Privacy

HrefHub makes HTTP requests to the URLs found on your site in order to check
their status. It does not phone home. The only other service it can use is the
optional safety check below, which is off unless you switch it on.

To spot parked domains, HrefHub looks up the name servers of linked websites
through your server’s own DNS resolver; no outside service is involved.

Each check identifies itself as HrefHub and includes your site’s address, so the
owner of a linked site can see who is checking. If a site refuses that check, it
is asked once more with ordinary browser headers. Only the address being checked
is requested; nothing about your site’s content or visitors is sent.

External services

Cloudflare 1.1.1.1 for Families (optional, off by default). When you switch on
Settings → Safety check, HrefHub asks Cloudflare’s family DNS resolvers
(family.cloudflare-dns.com and security.cloudflare-dns.com, over HTTPS) whether
the website of each external link is classified as adult content, malware or
phishing. Only the website’s host name is sent (for example example.com), when a
link is checked; never the page address, your content, or anything about your
visitors. Answers are cached for a week. Service:
https://developers.cloudflare.com/1.1.1.1/setup/ · Privacy policy:
https://developers.cloudflare.com/1.1.1.1/privacy/public-dns-resolver/ · Terms:
https://www.cloudflare.com/website-terms/

Installation

  1. Upload the hrefhub folder to /wp-content/plugins/, or install through Plugins → Add New.
  2. Activate the plugin.
  3. Open HrefHub in the admin menu and click Scan site. It collects every link, then checks each one’s status.

FAQ

Will it find links inside Elementor or ACF?

Not in this version. Those live in serialized meta and JSON rather than post
content, and reading — and more importantly, safely writing — them is a separate
piece of work. The plugin never claims to have scanned them: pages built with
Elementor are skipped entirely, and the admin screen tells you how many.

Is a bulk change reversible?

The last change is, in one click. Every post is snapshotted before it is written,
and undo restores it — unless you have edited that post since, in which case it is
skipped rather than overwriting your work. The version before the change is also
saved in the post’s Revisions, so you can go back from the editor as well. Undo
copies are kept for 90 days by default (Settings). HrefHub is not a site backup:
keep your host’s or a backup plugin’s daily backups switched on.

Why is a link marked “needs review” instead of broken?

Because the server answered in a way that does not prove the link is dead. Cloudflare
challenges, rate limits and bot filters all look like failures and are not. Nothing
is flagged broken until it has failed twice.

A link opens fine in my browser but stays in “needs review”. What can I do?

Choose Mark as working from the link’s menu (or the bulk actions). It then counts
as OK, with a “Checked by hand” tag, and is still checked: if the page is ever really
gone (404 or 410) the usual checks take over again, and after 90 days the mark ends
and the link returns to Needs review so someone looks at it again.

An old link now goes to a spam or adult site. Can HrefHub find these?

Yes — that usually happens when a linked domain expires and someone else buys it.
Every time a link is checked, HrefHub looks for four signs and lists them under the
Risky filter: the link now redirects to a different website; it ends somewhere
other than where it went before; it lands on a domain-for-sale or parking page; or
(with the optional safety check switched on in Settings) Cloudflare classifies the
site as adult content, malware or phishing. Nothing is changed automatically: open
the link, then unlink it, change it, or choose This link is fine. Replacing
redirects never follows a risky link.

Why is a link that redirects shown as Broken?

Because the page it was for is gone. Many sites send every removed page to their
home page, or to a “page not found” page that still says 200 OK. HrefHub looks at
where a redirect lands: if a deeper link now ends on the home page, a category,
tag, shop or blog index page, a not-found page, or a page that answers 404, the content your post linked to no longer
exists there. Replacing the link with the home page would not help your readers,
so these are listed as Broken (after failing two checks) for you to remove or
point somewhere useful.

Can I get a list of what was fixed, for a client?

Yes. Report of fixes made (PDF) on the Links screen opens a report of every link HrefHub changed
or removed, post by post, plus links marked as working or ignored, with who did it
and when. Choose since the last report, a preset range, your own dates, or all time,
then print it or save it as PDF. Changes made in the editor are not part of it.

Does it slow my site down?

No. Scans run in the admin screen on demand, and the only other work is a quick local re-read of a post’s links when it is saved, trashed or deleted. Nothing hooks the front end.

What happens when I uninstall?

Its database tables (including the fix report history) and all its options are removed.

Changelog

1.9.0

  • New: “Mark as working” for a link the checker cannot get through to — blocked by Cloudflare or another bot filter, or timing out — that opens fine in your browser. Pick it from the row’s menu or the bulk actions. The link shows as OK with a “Checked by hand” tag and is still checked: if the page is ever really gone (404 or 410) it goes back to the usual checks, and after 90 days the mark ends on its own and the link returns to Needs review.
  • New: “Report of fixes made” — a printable report of the fixes HrefHub made, post by post: what was done, old and new URL, who did it and when, and whether it was undone later, with a summary at the top. Choose since the last report, the last 7 or 30 days, this month, last month, your own dates, or all time, then print it or save it as PDF from the browser. Changes are recorded from this version on.
  • New: Risky links — finds old links that now lead somewhere they should not, usually because the domain expired and was bought by someone else. Each check looks for a redirect to a different website, a destination that changed since the link was first checked, and domain-for-sale or parking pages; an optional safety check (Settings, off by default) asks Cloudflare’s family DNS whether the site is adult content, malware or phishing. They are listed under a new Risky filter with the reason. Nothing is changed automatically; “This link is fine” in the link’s menu accepts it until it goes somewhere else.
  • New: “Replace safe redirects” — with the Redirects filter open, one button points every redirect to the same page (http to https, www or a slash) at its final address. Large sites are done in batches, and each run is one Undo. Moved-page and other-website redirects are fixed one by one, and risky redirects are left out.
  • Fixed: a redirect is no longer listed as working when the page it was for is gone. When a link redirects, HrefHub now loads the page it lands on once (the first 16 KB): a 404 or 410 there makes it Broken (some servers answer the quick check with 200 and a browser with 404); a deep link that now lands on the site’s home page, on a category, tag, shop or other listing page, or on a “page not found” page served as 200, is also Broken, with the reason shown. These are no longer offered as redirects to “fix”, so a link to an article is never replaced with a home page.
  • New: redirects are sorted by kind — HTTPS only (same address, http became https), www or slash, Moved page (another page on the same site) and Other website — with a filter for each under Redirects and a tag on every link.
  • Calmer Links screen: the filters come first, with a box for the open filter right under them; one main button (Scan site); “Download link list (CSV)” and the report are small links on the right; search sits in the same row as the other table controls; searching keeps the open filter; the backup reminder is one short line.
  • The fix report uses the HrefHub brand colour.
  • Safer updates: database changes now run once, in wp-admin only (never on a visitor’s page view), with a lock so busy sites cannot run them twice at the same time. If the database refuses (for example no permission to alter tables), HrefHub pauses itself with a notice instead of failing, and tries again later.
  • Safer changes: a post is never changed unless its undo copy was saved first, a refused save is reported instead of logged, and Undo keeps working when another plugin adjusts content on save.
  • Fixed: for users without the unfiltered_html capability (for example site admins on multisite), changing or removing a link could strip embeds, iframes and scripts from the rest of the post. The rest of the post is now saved exactly as it was.
  • Link checks stop starting new links after about 15 seconds per request, so very slow sites can no longer push a request past the server’s time limit; a link whose check was cut off is not retried first again and again.
  • Old undo copies are deleted in small chunks, and the CSV download uses standard quoting (no PHP 8.4 notices).
  • New: “Use redirect destination” in a redirecting link’s menu opens Change URL with the destination filled in and the posts that will change already listed.
  • Fixed: replacing redirects now only follows links that are in the Redirects state, never a stored destination of a link that has since stopped working. When several links are changed in one run, Undo puts them all back, including posts that had more than one of them.
  • New: before changing a post, HrefHub saves its current version in WordPress Revisions, so you can always go back from the editor too — even on a post that was never edited before. (Only when revisions are on for that post type.)
  • New: “Keep undo copies for” setting (30, 90, 180 or 365 days; default 90). Older undo copies are deleted once a day, so the database does not keep growing; the copy behind “Undo last change” is always kept. Before, they were never deleted.
  • New: a one-time reminder to make sure the site has a backup before changing links. “Got it” hides it for good.
  • For developers: the hrefhub_report_brand filter changes the report’s branding, and the hrefhub_report_buttons action adds buttons to the report panel.
  • The review screen is now “Remove or change links (review first)”: it can also keep a link and point it somewhere new. Give each link a new URL once (or click “Use redirect destination” for a link that redirects), then choose “Change link to new URL” per paragraph. Only the link address changes; the words and other link settings stay the same.
  • The review screen shows each link’s status and reason, as on the Links screen, and has an Ignore box per link. A paragraph whose links are all ignored stays as it is; in a paragraph with an ignored link, only the other links change, and the “After saving” preview shows that.
  • Ignoring a link, or bringing it back, now also ends a “Mark as working”.
  • “Links” and “Settings” links under HrefHub on the Plugins screen. The plugin’s home page and author are now HrefHub (hrefhub.com).
  • For developers: new filters hrefhub_hand_check_days (default 90) for how long “Mark as working” lasts, hrefhub_check_time_budget (default 15 seconds), hrefhub_redirects_per_run (default 25) for “Replace safe redirects”, hrefhub_backup_days for how long undo copies are kept, and hrefhub_redirect_services, hrefhub_domain_marketplaces, hrefhub_parking_nameservers and hrefhub_check_parking for the risky-link checks, and hrefhub_check_landing_page, hrefhub_not_found_titles, hrefhub_listing_segments and hrefhub_listing_pages for the landing-page check.

1.8.0

  • New bulk action: “Remove links (review first)”. Select links — for example every broken external link — and HrefHub shows each paragraph that uses them before anything changes. For each paragraph choose: remove the link and keep the words, remove the link and its words, edit the text, or leave it as is.
  • Link text that means nothing without the link (“here”, “click here”, “read more”) is marked “Rewrite needed” and opens ready to edit. Links whose text is just the web address default to removing the words too.
  • Nothing changes unless you choose it: every paragraph starts as “Leave as is” and shows a suggestion; “Use suggestions” applies them all.
  • The whole run saves as one change you can undo once. Posts edited by someone during the review are left alone and shown again.
  • Fewer false “Needs review” results: when a site’s bot filter (such as Cloudflare) refuses the quick check, HrefHub asks once more the way a browser would, and keeps the answer when the page loads, redirects or is gone.
  • Simpler Links screen: the summary boxes and the “Review issues” button are replaced by one row of filters with counts — All, Broken, Needs review, Redirects, OK, Unchecked. The host dropdown is gone (search finds a site’s links instead), and the page-builder note is one line in the status bar.
  • For developers: HrefHub_Remove_Page::start( $ids ) opens the review screen with any selection, and the new hrefhub_toolbar_buttons and hrefhub_remove_screen_top actions let add-ons extend the screens.
  • Security hardening: every write checks that you could edit that post yourself; replacement URLs that could break out of the link markup are refused; exported CSV cells can no longer run as spreadsheet formulas; undo only accepts genuine change ids; checker user agents cannot add header lines; empty index files block folder listings.

1.7.1

  • Re-checking selected links from the bulk actions no longer keeps the page loading until every link is done: they are checked a few at a time with a progress bar, the last link checked, a Stop button and a summary.
  • Stopping “Check links” part-way no longer leaves links with a status but “Last checked: never”. Each link keeps its real check date.

1.7.0

  • Everything HrefHub shows now sits in one panel, with its own header and its own message style, so its messages no longer mix with other plugins’ notices at the top of the page.

1.6.0

  • The Issues view is split into two sections — Broken, then Needs review — each with a short note on what to do.
  • The Status column now explains each link in plain words (“Page not found”, “Timed out”, “Blocked by Cloudflare — not a dead link”) instead of raw server messages, which stay available on hover.
  • A link that has failed once now says it will be confirmed on the next check, so a 404 is never silently waiting.
  • A “Review N issues” button at the top goes straight to everything that needs fixing.
  • All / Internal / External is now a one-click switch above the table.
  • The summary cards show how many problem links are on this site and how many point elsewhere.

1.5.0

  • Cleaner top of the screen: one status line (last scan, posts, links and the places they appear), and three buttons — Scan site, Check links, Export CSV — that give way to a single Stop button while a scan runs.
  • Summary cards ordered by severity — Broken, Needs review, Redirects, Links found — with a plain explanation of what “Needs review” means.
  • New Issues filter: broken, needs-review and unreachable links together.
  • Each row has a visible “Change URL” button; Re-check, Ignore and Unlink are in a small menu beside it.
  • Status labels carry an icon as well as a colour, and blue is now used only for buttons and links.

1.4.0

  • Changing a URL now opens a proper dialog: type the new URL, preview every post that will change, then confirm. Errors show in the dialog instead of browser pop-ups.
  • Unlink asks for confirmation in a dialog that says how many places the link will be removed from.
  • New “Check all links now” button re-checks every link without waiting for the weekly re-check.
  • A status line shows when the site was last scanned and when links are next due for a check.
  • Scan and check progress now has a progress bar, and a run with nothing to check says so instead of reloading straight away.
  • The summary counts are cards that filter the table to broken, redirecting or needs-review links.
  • A clearer first screen before the first scan, and a message after Undo saying what was restored.

1.3.0

  • Scanning now reports progress in two labelled steps: reading posts (with the number of links found so far), then checking link status.
  • Link checking shows how many are due before it starts, how many are done, the last link checked and its result, and why the remaining links are not being checked.
  • Links are checked in smaller batches, so the progress count moves steadily.
  • A summary is shown when a scan finishes or is stopped: posts read, links found, links checked, and the current number of broken, redirecting and needs-review links.

1.2.9

  • After changing or unlinking a URL, a message now says how many posts were changed and, when a run stops at its 50-post limit, how many still use the link.
  • Unlink now follows the same 50-posts-per-run limit as changing a URL.
  • The change preview counts every post that uses the link, not just the first few hundred.
  • CSV export now includes every link in the current view instead of stopping at 5,000.
  • Scan and check progress now say what is being counted, and how many links were skipped from checking and why.

1.2.8

  • Pages built with Elementor, Beaver Builder or Bricks are no longer scanned or changed. Those builders display a page from their own data, so a change to its post content was reported as done but never reached visitors. The admin screen now says how many were skipped.
  • Unlink no longer removes the link from a button block, which left the block invalid, and now also finds relative links.
  • Link checks refuse private and local network addresses, and never download more than a few kilobytes of a page.
  • The change-URL preview can now be translated.
  • Uninstalling also removes the saved “links per page” screen option.

1.2.7

  • Updated author details.

1.2.6

  • Admin notices after saving settings or running a bulk action are now stored on the server instead of being passed in the page address.

1.2.5

  • Code hardening for the WordPress.org Plugin Check: every database query now passes table names through $wpdb->prepare(), and every AJAX request verifies its security token before reading any input.
  • Tested up to WordPress 7.1.

1.2.4

  • Links to your own archives — custom post type archives, category, tag and author pages — are now resolved properly instead of reported as “could not be resolved”. Links to files such as PDFs and images are recognised too.

1.2.3

  • A link refused by Cloudflare, Akamai, Imperva, Sucuri, DataDome or AWS WAF now says which service blocked it, instead of a generic “blocked by the host”. These are bot filters, not dead links — the page usually loads fine in a browser.

1.2.2

  • Scan site now checks link status too, straight after collecting links, with a progress count and a Stop button. The separate Check link status button is gone. A scan only re-checks links that are new or were last checked more than 7 days ago.
  • Saving a post updates its links in the inventory straight away. New links are checked on the next scan.

1.2.1

  • Fix: links in trashed or deleted posts stayed in the inventory, and replace-everywhere could still rewrite them. Trashing or deleting a post now removes its links straight away, and restoring it from the trash scans it again.
  • Fix: a full scan now drops links recorded for posts it no longer reaches, so rows left behind by earlier versions are cleaned up.

1.2.0

  • New Settings screen: choose which post types are scanned, with a count of each. Unticking a type removes its links from the inventory straight away; post types added later by other plugins are scanned by default.
  • Fix: links were re-checked early or late by the site’s UTC offset, because the last-checked time was stored in site time but compared in UTC. Old undo snapshots were pruned on the same shifted schedule.

1.0.0

  • First release: link inventory from post content and Gutenberg blocks, status and redirect checking, replace-everywhere with preview and one-step undo, bulk redirect flattening, CSV export.