Module which tracks external broken links in SilverStripe CMS pages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Sabina Talipova bef19ec35c
Merge pull request #86 from creative-commoners/pulls/2/stop-using-depr
2 months ago
.github/workflows MNT Standardise modules 6 months ago
.tx re-add transifex config as it was removed from the wrong branch. 5 years ago
_config Add legacy.yml for SS3 to SS4 upgrades 4 years ago
client FIX Move files to client directory 6 months ago
lang Update translations 9 months ago
src API Stop using deprecated API 2 months ago
tests Merge branch '2.2' into 2.3 9 months ago
.editorconfig NEW Add loading animation to Create Report button, fix bug in CurlLinkChecker 5 years ago
.gitattributes Update supporting items for SilverStripe 4 conventions 5 years ago
.upgrade.yml FIX Linting errors for code cleanliness 5 years ago MNT Standardise modules 6 months ago
behat.yml MNT Add behat tests 1 year ago Update changelog for 1.0.5 7 years ago Added standard code of conduct 7 years ago
codecov.yml Update supporting items for SilverStripe 4 conventions 5 years ago
composer.json Merge branch '2.3' into 2 6 months ago Update supporting items for SilverStripe 4 conventions 5 years ago
phpcs.xml.dist MNT Use shared travis config, use sminnee/phpunit 2 years ago
phpunit.xml.dist MNT Standardise modules 6 months ago

External links

CI Silverstripe supported module


The external links module is a task and ModelAdmin to track and to report on broken external links.

Maintainer Contact


  • Silverstripe ^4.0

Note: For a Silverstripe 3.x compatible version, please use the 1.x release line.


  • Add external links to broken links reports
  • Add a task to track external broken links


  1. Require the module via composer: composer require silverstripe/externallinks
  2. Run /dev/build in your browser to rebuild the database.
  3. Run the following task to check for broken external links


A new report is added called 'External Broken links report'. When viewing this report, a user may press the "Create new report" button which will trigger an ajax request to initiate a report run.

In this initial ajax request this module will do one of two things, depending on which modules are included:

  • If the queuedjobs module is installed, a new queued job will be initiated. The queuedjobs module will then manage the progress of the task.
  • If the queuedjobs module is absent, then the controller will fallback to running a buildtask in the background. This is less robust, as a failure or error during this process will abort the run.

In either case, the background task will loop over every page in the system, inspecting all external urls and checking the status code returned by requesting each one. If a URL returns a response code that is considered "broken" (defined as < 200 or > 302) then the ss-broken css class will be assigned to that url, and a line item will be added to the report. If a previously broken link has been corrected or fixed, then this class is removed.

In the actual report generated the user can click on any broken link item to either view the link in their browser, or edit the containing page in the CMS.

While a report is running the current status of this report will be displayed on the report details page, along with the status. The user may leave this page and return to it later to view the ongoing status of this report.

Any subsequent report may not be generated until a prior report has completed.

Dev task

Run the following task to check your site for external broken links.

Queued job

If you have the queuedjobs module installed you can set the task to be run every so often.

Whitelisting codes

If you want to ignore or whitelist certain HTTP codes this can be setup via ignore_codes in the config.yml file in mysite/_config:

    - 401
    - 403
    - 501

Upgrading from 1.x to 2.x

When upgrading from 1.x to 2.x (Silverstripe 3.x to 4.x) you will need to be aware of the following API changes:

  • Configuration property CheckExternalLinksTask.IgnoreCodes renamed to CheckExternalLinksTask.ignore_codes
  • Configuration property CheckExternalLinksTask.FollowLocation and BypassCache renamed to follow_location and bypass_cache

Follow 301 redirects

You may want to follow a redirected URL a example of this would be redirecting from http to https can give you a false poitive as the http code of 301 will be returned which will be classed as a working link.

To allow redirects to be followed setup the following config in your config.yml

# Follow 301 redirects
  follow_location: 1

Bypass cache

By default the task will attempt to cache any results the cache can be bypassed with the following config in config.yml.

# Bypass SS_Cache
  bypass_cache: 1


You may want to set headers to be sent with the CURL request (eg: user-agent) to avoid website rejecting the request thinking it is a bot. You can set them with the following config in config.yml.

# Headers
    - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0'
    - 'accept-encoding: gzip, deflate, br'
    - 'referer:'
    - 'sec-fetch-mode: navigate'