Broken Link Checker for OpenCart 4: Find and Fix Broken Links, Missing Images and Removed Videos (Free Extension)
A free OpenCart 4 extension that checks every link, image and embedded video in your products, pages, articles, reviews and banners, and lets you fix broken ones from one list.

Links in an online store break quietly. A supplier moves their price list, you delete a product that a category description still points to, an image never made it to the server, a YouTube video you embedded gets taken down. Nobody tells you. Shoppers click and land on an error page, and search engines spend their crawl on dead ends. Finding these before your customers do is the job of an OpenCart broken link checker.
OpenCart 4 has no way to find them. This free extension does: it reads every link, image and embedded video in your products, categories, information pages, CMS articles, reviews, comments, banners and HTML modules, checks them a few at a time in the background, and lists the broken ones with where they are. You fix them from that list. It covers what the popular Broken Link Checker plugin does for WordPress, built the OpenCart way with events and no core file changes. Tested on OpenCart 4.1.0.4.
Download: linkchecker.ocmod.zip (OpenCart 4.1.x, free, no core file changes)

What the OpenCart broken link checker does
- Finds links (
<a href>), images (<img>and the image fields of products, categories, brands and banners) and embeds (iframes, video and audio) in ten places, listed in the table below. - Sorts every URL into Broken, Warning, Redirect or OK, with the HTTP status code, the reason and how long it has been failing.
- Lets you fix links from the list: edit the URL everywhere it appears, unlink it, replace a redirect with its final URL, mark it as not broken, dismiss it or recheck it now. Bulk actions do the same for many links at once.
- Shows every place a URL appears (product, language, link text, the URL as written) and its last five checks.
- Re-reads a product, page or article as soon as you save it in the admin.
- Strikes through broken links on the storefront and adds
rel="nofollow", without changing your content. - Sends an email digest of new broken links, shows a notice on the dashboard and a counter in the Catalog menu.
- Suggests an archived copy from the Wayback Machine when a page is gone.
- Exports the list as CSV.
Install the extension
- Download linkchecker.ocmod.zip.
- Go to Extensions > Installer, click Upload, choose the zip and click the green Install button next to Broken Link Checker.
- Go to Extensions > Extensions, choose Modules, find Broken Link Checker and click the green +.
- Click the blue Edit button, open the Settings tab, switch Status on and click Save.
- Back on the Links tab, click Scan now. You can also open it later from Catalog > Broken Links.
Scan now runs short rounds until everything has been checked. On our demo store one 11-second round read 234 items and checked 114 links. After that, links are checked again every 72 hours, and you don’t need to click anything.
Where it looks for links
| Source | What is checked |
|---|---|
| Products | Description in every language, main image, additional images |
| Categories | Description, category image |
| Information pages | Description |
| Articles and topics (CMS, OpenCart 4.1) | Description |
| Product reviews and article comments | URLs typed into the text |
| Banners | Each slide’s link and image |
| Brands | Brand image |
| HTML modules | The content of every HTML module, in every language |
Each source can be switched off under Look for links in. With Only enabled items on (the default), disabled products and pages and unapproved reviews and comments are skipped. Plain-text URLs in descriptions, as opposed to real links, can be switched on under Link types.
Broken, warning or redirect: how a link is judged
| Status | When |
|---|---|
| Broken | 404, 410 and other 4xx answers; a store image or file that doesn’t exist on the server; a YouTube video that was removed; a temporary problem that failed three times in a row |
| Warning | Timeouts, server errors (5xx), DNS failures and refused connections until they repeat; sites that refuse automated checks (401, 403, 429); addresses on a private network, which are never requested |
| Redirect | The link works but goes through one or more redirects first. The final URL is shown |
| OK | A 2xx answer, or a store file that exists |
Warnings are rechecked after 6 hours instead of 72. This is the part of the check that decides when a warning becomes broken:
if ($status == 'ok' || $status == 'redirect') {
$failures = 0;
} elseif ($status == 'fail') {
// Temporary problems (timeouts, server errors) are warnings until they repeat.
$failures++;
$status = (!$this->s['warnings'] || $failures >= max(1, (int)$this->s['threshold'])) ? 'broken' : 'warning';
$next = $status == 'warning' ? max(1, (int)$this->s['retry']) : $interval;
} elseif ($status == 'warning') {
$failures++;
$status = $this->s['warnings'] ? 'warning' : 'broken';
} else {
$failures++;
Two kinds of links get special treatment. YouTube shows a normal page even for removed videos, so YouTube links are checked through YouTube’s oEmbed endpoint, which answers 400 or 404 when the video is gone. Images and files on your own store are checked on disk, which is faster and works even when the server can’t reach its own domain.
Fix links from the list
Every row has its actions under the URL:
- Edit URL replaces the URL in every product, page, review or banner where it appears, in every language. In our test one edit changed both an information page and a customer review.
- Unlink removes the link and keeps its text. Images and embeds are removed.
- Fix redirect replaces the URL with the final address it redirects to.
- Not broken is for false alarms. The link stays OK even if later checks fail.
- Dismiss hides a link from the lists. It is still checked.
- Recheck checks it right away and shows the result.
- Details lists every place the URL appears and its last checks.

When you edit a URL, Suggestions asks the Internet Archive for the closest saved copy of the page. If the original is gone for good, the archived copy is often the best replacement for a reference link.

The tabs above the list filter by status, and the search box finds a URL, link text or source name. You can also filter by where the link was found, the link type, and internal or external. Export CSV downloads the current view with one row per place a link appears.
Settings

- Exclusion list: links whose URL contains any line of this list are not checked, for example an affiliate domain.
*matches anything. - Check each link every (72 hours) and Retry failing links after (6 hours).
- Broken after: how many failed checks in a row turn a timeout or server error into a broken link (3).
- Report temporary problems as warnings: switch it off to report every failure as broken straight away.
- Timeout (20 seconds) and Wait between requests to the same site (1,000 ms), so no site sees a burst of requests from your store.
- User agent: some sites refuse requests that don’t look like a browser.
- Fetch internal links through: leave it empty. It is only for servers that can’t open their own public address, like our Docker test store, where it is set to
http://127.0.0.1.
Running the checks without slowing the store
Nothing is checked while a shopper loads a page. Checks run in short rounds of at most 20 seconds, in one of three ways:
- While the admin is open: any admin page starts a short round every few minutes. This is what the WordPress plugin does too, and on most stores it is enough.
- Cron URL: the settings show a URL with a secret key. Call it every hour from your hosting’s cron, for example
wget -qO- "URL" >/dev/null. A wrong key gets a 403. - OpenCart cron: the extension adds a
linkcheckerjob to Extensions > Cron Jobs. It runs if your server runs OpenCart’scron.php. On 4.1.0.4,cron.phpfails from the command line because it doesn’t load Twig, so the cron URL is the reliable choice there.
A database lock makes sure only one round runs at a time, so two open admin tabs and a cron job don’t check the same links twice. Unchanged items are skipped, because each one is stored with a hash of its content.
Broken links on the storefront, the dashboard and email
Until you fix them, broken links in your content get the class blc-broken, struck through by default, and rel="nofollow" so search engines don’t follow them. You can also hide them: the text stays and the link goes. All three happen as the page is shown. Your descriptions aren’t changed. Switch on Only for logged-in admins to preview the styling before shoppers see it.

The dashboard shows a notice while broken links are waiting, and Catalog > Broken Links shows a red counter. With Email new broken links on, each round that finds new broken links sends one email listing them, and links already reported aren’t sent again. It uses your store’s mail settings in System > Settings > Mail.


How it is built
The checker lives in one class in the extension’s system/library folder, so the admin and the storefront share it. Admin model events re-read an item after addProduct, editProduct, deleteProduct and the same methods for categories, information pages, articles, topics, reviews, banners, brands and modules. Storefront view events add the class and nofollow. No core files are edited. If events are new to you, OpenCart 4 events by examples explains how they work.
The checker follows redirects itself, at most five, and checks every address before connecting. Review and comment text comes from customers, so without this check a review could make your server request an address on its own network:
$ips = $this->lookup($host);
if (!$ips) {
return ['code' => 0, 'errno' => 6, 'error' => '', 'location' => ''];
}
foreach ($ips as $ip) {
if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
return ['code' => 0, 'errno' => 0, 'error' => '', 'location' => '', 'blocked' => 1];
}
}
Only http and https are requested, at most 64 KB of each response is read, and the server’s answer is never shown as HTML in the admin. The list, the actions and the settings follow OpenCart’s user group permissions for the extension.
What we found when testing
We tested on OpenCart 4.1.0.4 with the demo data, plus an information page and a review full of good and bad links:
- Scan: 234 items read and 114 links checked in one 11-second round.
- 404s: a deleted blog page and a link to
product_id=99999(OpenCart answers 404 for missing products) were broken at once. The same URL in the page and the review counted as one link in 2 places. - Removed video: the embedded YouTube video that doesn’t exist was broken. The working one was OK.
- Temporary errors: a 500 error and a domain that doesn’t exist were warnings, and became broken after the third failed check.
- Bot blocking: opencart.com answered 403 to the checker and stayed a warning, which is correct: the site works in a browser.
- Private network: a link to
10.0.0.5was not requested. - A real find: the demo store’s HTC and Hewlett-Packard brand logos,
catalog/demo/htc_logo.jpgandhp_logo.jpg, don’t exist on the server. - Saving in the admin: editing the review updated the list straight away. Disabling it removed its link, and enabling it brought the link back.
- Email: the digest listed 6 new broken links, and the next round sent nothing.
- Wayback Machine: the availability API sometimes timed out on a full URL (
"client timeout at 5.0 seconds") but answered for the same URL withouthttps://, so the extension asks both ways.
Limitations
- Links in theme templates, footer settings and other extensions’ settings are not checked. Only the sources in the table above are.
- A site that blocks automated checks stays a warning. Open those links in a browser before you change them.
- Links behind a login, or pages that answer 200 with a “not found” message, look fine to any checker.
- Uninstalling removes the events and the cron job but keeps the results, so dismissed and not-broken marks come back if you reinstall.
When you change a URL on your own store, set up a redirect so old links keep working. The OpenCart Redirects Manager does that. To see which broken URLs Google has already found, check the “Not found (404)” reason in our guide to Search Console page indexing for online stores.
Related posts
- SEO Toolkit for OpenCart 4
- IndexNow for OpenCart 4
- OpenCart Redirects Manager module
- OpenCart 4 events by examples







