
Hide specific links from crawlers without breaking design or accessibility. Lightweight, reversible, and SEO-safe.
JS Links lets you obfuscate links so crawlers can’t follow them — while users still can.
It replaces <a> tags with accessible <span> elements (role="link", tabindex="0") containing Base64-encoded URLs.
✅ Use cases
– Hide links to legal pages, login, or affiliate URLs
– Prevent PageRank dilution in footers or widgets
– Keep a clean, SEO-friendly internal linking structure
✅ Key features
– Lightweight, no external calls or tracking
– 100 % reversible (disable = restores original links)
– Works with all SEO plugins (Yoast, Rank Math, SEOPress)
– Compatible with any theme or builder
– Accessible (keyboard navigation supported)
– Optionally disable obfuscation on specific pages
– Custom CSS styling per area (content, menu, footer, widget)
✅ Why not just use nofollow?
Because nofollow links are still visible to crawlers and can leak PageRank.
JS Links removes the href entirely and hides the destination — Google can’t see it, so no PageRank flows.
✅ Safe and compliant
JS Links follows WordPress coding standards and includes:
– URL sanitization (esc_url_raw())
– Output escaping (esc_attr(), wp_kses_post())
– CSS filtering (safecss_filter_attr())
– Protection against reverse tabnabbing (noopener noreferrer)
???? Result: total control of your internal link flow, with zero impact on UX.
Description (FR)
JS Links permet d’obfusquer certains liens pour empêcher Google et les robots d’exploration de les suivre — tout en conservant un comportement identique pour l’utilisateur.
Les balises <a> sont remplacées par des <span> cliquables (role="link", tabindex="0") contenant l’URL encodée en Base64.
✅ Cas d’usage
– Empêcher la transmission de PageRank sur les liens non stratégiques (CGU, mentions légales, etc.)
– Bloquer les liens d’affiliation ou externes sans casser le design
– Préserver un maillage interne propre et hiérarchisé
✅ Fonctionnalités
– Ultra-léger et 100 % réversible
– Compatible avec tous les thèmes et plugins SEO
– Accessible au clavier
– Personnalisation visuelle simple (CSS par zone)
– Exclusion possible de certaines pages
✅ Différence avec nofollow
Un lien nofollow reste une balise <a> visible par Google.
JS Links, lui, supprime l’attribut href et encode l’URL — donc Google ne voit pas le lien.
✅ Sécurité
JS Links respecte les bonnes pratiques WordPress :
– Nettoyage et validation des URLs
– Échappement systématique des sorties
– Filtrage CSS sécurisé
– Protection contre le reverse tabnabbing
– Fallback sans JavaScript (<noscript>)
???? En clair : tu gardes ton jus SEO sans sacrifier ton ergonomie.
Credits
Developed and maintained by Pierre Ribeaucourt
Support
If you encounter any issues or have suggestions, feel free to open a thread on the Support Forum.
FAQ
How is this different from rel=”nofollow”?
A nofollow link is still a visible <a> tag and may leak PageRank.
JS Links removes the href attribute and encodes the URL — Google doesn’t follow it.
Is it compatible with SEO plugins like Yoast, Rank Math, or SEOPress?
Yes. JS Links runs after SEO plugins and doesn’t interfere with their output.
Is it accessible?
Yes — links are fully keyboard-activable (Enter / Space) via role="link" and tabindex="0".
However, some screen readers that only list real <a> links may skip them.
We recommend not obfuscating critical navigation or accessibility links.
Can I exclude specific pages?
Yes, by listing their relative URLs (e.g., /, /contact, /legal) in the exclusion field.
/contact and /contact/ are treated as the same page, and full URLs work too.
What if JavaScript is delayed or blocked?
Obfuscated links are briefly hidden while the script prepares them. If the script is delayed (for example by a caching or “delay JS” plugin), they appear anyway after 1.5 seconds, as plain text. Without JavaScript, they stay visible as text.
ChangeLog
2.2.2
- Fixed: with “Customize” selected, a custom CSS field left empty was saved as
display:none, which hid the obfuscated links of that area (bug present since 2.0.0). Values affected by this bug are cleaned up automatically on update.
- Changed: with “Customize” selected, whatever you leave empty now keeps your theme style, exactly as with “Keep theme style”. Only the settings you fill in are applied. An unticked “Underline” no longer forces
text-decoration: none: to remove an underline, add text-decoration: none in the custom CSS.
2.2.1
- Fixed: page exclusions set with
rel="jsl-exclude:/" or with the jsl-exclude() class on the link itself were ignored on the server, so the link stayed obfuscated on excluded pages (bug present since 2.0.0).
- Fixed: on an excluded page, the
[jslink] shortcode now outputs a real link that search engines can see.
2.2.0
- Redesigned settings page, easier for beginners: a short guide to obfuscating a link (editor, menus, shortcode), a simple choice between keeping the theme style and customizing it, one tab per site area, and a live preview of normal and hover styles.
- Bold, italic and underline are now toggle buttons; the color picker opens over the page.
- The preview warns when custom CSS already sets a color that overrides the color picker.
- Custom CSS and the menu reference-link selector moved to collapsible advanced sections.
- New “Settings” link on the Plugins screen.
- Settings page texts are translatable. No setting has changed: existing options are kept as they are.
2.1.0
- Faster and safer conversion: links are rewritten with the WordPress HTML API (WP_HTML_Tag_Processor) instead of DOMDocument. The rest of the page is left byte for byte: no more stray
<?xml encoding="UTF-8"> markers, accents and inline SVG are preserved.
- Fixed: when several obfuscated links followed each other, some were converted by a fallback that dropped their
title attribute.
- Fixed: anchors (
#), relative URLs (?…), mailto: and tel: links no longer open in a new tab.
- Fixed: URLs with accents or non-Latin characters (e.g.
/catégorie/) now open the right page.
- Fixed: obfuscated links did nothing in menus whose theme stops click propagation, such as the OceanWP mobile menu. Clicks are now caught before the theme, and a click cancelled by another script (preventDefault) is respected, as with a real link.
- Fixed: middle-click now opens the link in a new tab, like Ctrl/Cmd/Shift-click.
- Security: links opened in a new tab use
noopener (and noreferrer for external sites).
- Page exclusions:
/contact and /contact/ match the same page; full URLs are accepted.
- Obfuscated links can no longer stay hidden: they appear after 1.5 s even if JavaScript is delayed, and the script also works when loaded late.
- Links added after page load (AJAX, page builders) are converted too.
- Classic and block widgets are processed on the server.
- Other attributes of the original link (id, style, data-*) are kept on the span.
- Gutenberg: empty the URL to remove a JS Link.
- Front script loaded with
defer.
- Requires WordPress 6.2 or later. Tested up to WordPress 7.1.
2.0.0
- Initial WordPress.org release
- WP 6.8 compatibility / PHP 7.4+
- Improved accessibility and sanitization