How to disable Link Click Counters?

AI-generated summary

In a discussion titled ‘How to disable Link Click Counters?’ under the Dev category, Plabforum asked how to hide or restrict visibility of link click counters, which distract users on their forum. Arkshine suggested using CSS to hide counters for everyone or only for non-staff members, referencing a prior solution from Joshua Rosenfeld. However, MarcP pointed out that this method leaves behind unwanted whitespace, making text appear awkwardly spaced. In response, keegan announced a recent Discourse update that improves click counter handling — notably, text copying no longer includes click counts — and provided a more effective CSS fix: a[data-clicks]::after { display: none; }, which avoids leaving extra spaces. This solution is linked to a GitHub pull request (#29453). MarcP thanked keegan for the timely and helpful response. The discussion highlights a common UX concern and offers a clean, updated technical workaround for forum administrators seeking to improve readability while retaining click tracking functionality for staff.

How can I disable the clicks that are visible corresponding to the link?

Or make it visible only to the staff. It’s distracting the users of the forum as our forum is highly dependent on complying multiple posts and using links to compile them.

To hide them for everyone, you can follow this CSS snippet:

For staff only, you can use this CSS instead:

body:not(.staff) .badge.badge-notification.clicks {
    display: none;
}

This leaves a hidden whitespace.. which makes sentences ending with a hyperlink look weird .

Notice the space between the d and dot.

I know it’s a small thing but it looks very off. I’ve been looking for a solution but haven’t been able to find something yet..

@MarcP

We’ve pushed an update to how click counters are implemented. There are some improvements now such as copying text doesn’t pick up click counter numbers.

You should be able to hide click counters by doing the following, and it should not leave any spaces in between.

a[data-clicks]::after {
     display: none;
}

https://github.com/discourse/discourse/pull/29453

Hey @keegan, thank you so much for getting back to me on this, appreciate it a lot!