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(10mo ago)02.1k1MITPHP

Since Dec 21Pushed 10mo 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 yesterday

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

42

—

FairBetter than 90% of packages

Maintenance54

Moderate activity, may be stable

Popularity19

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

312d 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/multi-domain

Allows multiple domains to access one CMS instance, mapping them to different sections of the hierarchy

141.6k](/packages/silverstripe-multi-domain)

PHPackages © 2026

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