Guide

Shorten every outbound link on your site with one script.

Add your website's domain, paste a single snippet into your pages, and your outbound links are converted to shortlinks automatically.

How to install

  1. Add your domain

    Open the Website Script tool in your dashboard and choose Add domain. Enter the domain of the site where you'll use the script, for example myblog.example.com.

  2. Copy your snippet

    Each domain gets its own unique snippet. Use the Copy snippet button next to the domain you added.

  3. Paste it before the closing body tag

    Place the snippet near the end of your HTML, right before </body>, after all your page content.

  4. Load a page to test

    Open one of your pages in a browser. After a moment, its outbound links are replaced with SafeLinkMe shortlinks.

Snippet format
<script src="https://api.safelinkme.net/ws.js" data-site="YOUR_SITE_KEY"></script>

Always copy the snippet from your dashboard. It already contains your own site key.

Which links get converted

The script looks at the links on the page when it loads and converts links that point to other websites. These are left as they are:

Links to your own site

Any link that points to the same domain as the page it sits on is skipped.

Email, phone, and script links

Links starting with mailto:, tel:, or javascript: are skipped.

Links you exclude

Add the attribute data-slm-skip to any link you want to keep unchanged, for example <a href="https://example.com" data-slm-skip>.

Links that your page adds later with JavaScript, after the script has run, are not converted.

Good to know

One snippet per domain

A snippet only works on the domain it was created for. A different site, or a different subdomain, needs its own domain added. Entering www.example.com or https://example.com/page is fine, it is saved as example.com.

Conversion takes a moment

Links change shortly after the page loads. Links converted before are remembered in the visitor's browser, so they switch instantly on later visits.

Big pages convert in steps

The script handles a limited number of new links per visit. If your page has many outbound links, the rest are converted over the next visits.

Same URL, same shortlink

If a URL already has a shortlink in your account, that shortlink is reused instead of creating a new one.

Domain limit

Your account can connect a limited number of domains, and adding domains is limited over time. The Website Script page shows how many you've used.

Removing a domain

When you remove a domain, its snippet stops creating new links right away. Links that visitors' browsers already remember may keep working for a while.

Track your results

The Website Script page shows links shortened, total views, and estimated earnings for the last 7 days.

Troubleshooting

Links are not converting

Check that the snippet sits before the closing body tag, still contains your data-site value, and is used on the exact domain you added. Also make sure the domain still appears in your connected sites.

Only some links convert

Links to your own domain and links marked data-slm-skip are skipped on purpose. If you have many links, or you've hit your link creation limit, the remaining ones convert on later visits.

Cannot add a domain

Enter a valid domain such as example.com. A domain you already added, a full domain list, or too many attempts in a short time will be refused. Wait a while and try again.

Script is unavailable

If you see a maintenance message, the tool is temporarily paused. Try again later.

Ready to add the script?

Connect your domain and copy your snippet from the dashboard.