PHPackages                             axllent/silverstripe-links-to-blank - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. axllent/silverstripe-links-to-blank

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

axllent/silverstripe-links-to-blank
===================================

Extension to add add target="\_blank" to all outgoing links &amp; downloads

3.0.0(1y ago)02.1k1MITPHP

Since Dec 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/axllent/silverstripe-links-to-blank)[ Packagist](https://packagist.org/packages/axllent/silverstripe-links-to-blank)[ Docs](https://github.com/axllent/silverstripe-links-to-blank)[ RSS](/packages/axllent-silverstripe-links-to-blank/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (15)Used By (0)

Automatically set `target="_blank"` for outgoing &amp; file links in Silverstripe
=================================================================================

[](#automatically-set-target_blank-for-outgoing--file-links-in-silverstripe)

This module enhances your HTML output by automatically adding `target="_blank"` to all **outgoing** links and internal "download links" (e.g., PDF, ZIP, TAR, DOC, PPT, and Excel files).

Earlier versions of this module used JavaScript for similar functionality, but that approach caused compatibility issues with tools like the Wayback Machine.

Features
--------

[](#features)

- Automatically adds `target="_blank"` to outgoing and internal file links.
- Includes `rel="noopener"` to outgoing links to prevent [cross-site exploits](https://mathiasbynens.github.io/rel-noopener/).
- Optionally adds `rel="nofollow"` and `rel="noreferrer"` to outgoing links.
- Allows adding custom CSS classes to file and external links for styling.
- Supports adding additional file extensions for custom file types.

Requirements
------------

[](#requirements)

- Silverstripe ^4 || ^5 || ^6

Installation
------------

[](#installation)

```
composer require axllent/silverstripe-links-to-blank
```

After installation ensure you have done a `?flush`. No further configuration is required.

Usage
-----

[](#usage)

To customise the module, you can define your own configuration:

```
Axllent\LinksToBlank\Middleware:
    ## Specify additional external hosts to exclude from processing.
    ## The current host is automatically excluded.
    ignore_hosts:
        - "www.example.com"

    ## Exclude links with this CSS class from being parsed (default: none).
    ignore_css_class: "ignore-link"

    ## Add a CSS class to all external links (default: none).
    add_css_external: "external-link"

    ## Add a CSS class to all file links (default: none).
    add_css_files: "download-link"

    ## Define custom file types to be treated as file links.
    ## Each file type should include the leading dot.
    add_file_extensions:
        - ".ext"

    ## Add rel="nofollow" to all external links (default: false).
    nofollow: true

    ## Add rel="noreferrer" to all external links (default: false).
    noreferrer: true
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance50

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~290 days

Recently: every ~737 days

Total

13

Last Release

365d ago

Major Versions

1.2.0 → 2.0.02017-01-29

1.2.1 → 2.0.12017-03-24

1.2.3 → 2.0.32017-10-17

2.x-dev → 3.0.02025-07-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1463435?v=4)[Ralph Slooten](/maintainers/axllent)[@axllent](https://github.com/axllent)

---

Top Contributors

[![axllent](https://avatars.githubusercontent.com/u/1463435?v=4)](https://github.com/axllent "axllent (43 commits)")

---

Tags

silverstripelinks

### Embed Badge

![Health badge](/badges/axllent-silverstripe-links-to-blank/health.svg)

```
[![Health](https://phpackages.com/badges/axllent-silverstripe-links-to-blank/health.svg)](https://phpackages.com/packages/axllent-silverstripe-links-to-blank)
```

###  Alternatives

[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[symbiote/silverstripe-gridfieldextensions

A collection of useful grid field components

951.9M272](/packages/symbiote-silverstripe-gridfieldextensions)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/tagfield

Tag field for SilverStripe

561.3M50](/packages/silverstripe-tagfield)[jonom/silverstripe-betternavigator

Front-end utility menu for Silverstripe websites featuring administration and development tools

60435.1k13](/packages/jonom-silverstripe-betternavigator)[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39344.8k31](/packages/lekoala-silverstripe-cms-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
