Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Ryan C.

    (@ryancowles)

    Hi Enri! I’m afraid that there isn’t a built in option to hide the share counter. However, there is a workaround that might do the trick if you’re comfortable working with some code.

    You could prevent the Javascript that generates the share counts from loading by adding the following filter to a functionality plugin or to your theme’s functions.php file:

    add_filter( 'sharing_js', '__return_false' );

    However, I would only recommend this method if you don’t use the “Email” sharing button, as this will also remove some functions that it requires.

    If you do use the Email sharing button, you’ll want to copy the Email button code and enqueue it with your own custom Javascript file.

    I added the filter you listed above to a functionality plugin and it worked! I would really like to use the Email sharing button though. Can you explain how to copy the Email button code and enqueue it with my own custom Javascript file?

    Thanks!

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    @brinekai A few months ago we created the jetpack_sharing_counts filter to allow site owners to disable Sharing counts without breaking anything else.

    You can find out more about here:
    https://jeremy.hu/jetpack-remove-the-share-counts-from-the-sharing-buttons/

    Thank you for getting back to me!

    I added the filter and, although it did remove the sharing counts, the email share button no longer works. Is there a way to remove the counter without breaking the email share? Or maybe I did something wrong?

    Thanks again!

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    @brinekai Could you post your site URL here, so I can have a look?

    If you want it to remain private, you can also contact us via this contact form:
    https://jetpack.me/contact-support/

    Thanks! I just sent a message via the contact form.

    Plugin Contributor Ryan C.

    (@ryancowles)

    @brinekai: Thank you! We’ll follow up via email.

    I also found that the filter broke the email button, even when I tried it on a clean install with no other plugins running. Hopefully a fix will come soon… I love the idea behind the filter. I even think there’s potential for it to be an option in the settings… if someone doesn’t want the counts, there’s not much reason to run that code.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    @david If you use the jetpack_sharing_counts filter instead, you shouldn’t have any issues with the email button.

    If you do, could you try to make the following changes and let me know if it helps?
    https://github.com/Automattic/jetpack/commit/8aeb6948ca1e8269bce713e4e20d63a348bc3128

    Thanks!

    I was using the jetpack_sharing_counts filter, and yes, that small adjustment to sharing.js fixes the issue. Glad to see there’s a fix!

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Thanks for giving it a try!

    The fix will be included in the next Jetpack update, scheduled to be released in a few days. If you’d like to test the upcoming release, you can download the Beta tester plugin here:
    https://jetpack.me/beta/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Share buttons and counters’ is closed to new replies.