How to Remove Social Share Buttons from Excerpts in Jetpack – WordPress

How to Remove Social Share Buttons from Excerpts in Jetpack – WordPress

I do like Jetpack as it offers a lot of things all built into one WordPress plugin, but there are some things that need to be tweaked. This tutorial focuses on removing the Social Share buttons from the excerpts in the blog’s homepage.

I removed the social share icons from the homepage excerpts because I know it adds to the load time of my blog, so anything that isn’t totally necessary should be removed.

Yes broadband speeds have become a lot faster than they used to be, but there are many people who still have slower connections or are using their mobile phones to browse the World Wide Web. And if it’s client side code such as JavaScript then this can also load slower if the client’s device i.e PC etc. has a low amount of R.A.M or processing power.

Incidentally if you want to customise the Jetpack Mobile theme then please read my step by step tutorial on how to edit Jetpack mobile Theme post.

It is annoying to have multiple share buttons on the same page so if you have ten article excerpts on the homepage then you will have ten sets of share buttons all attached to each excerpt. I don’t think we should be that desperate that we need to have excessive amounts of obtrusive components all over the webpage.

One of the things that I dislike when I’m browsing the web with my mobile device, is pages that have lots of client side scripts such as pop ups etc. these pages or websites aren’t customised for mobile browsers so it’s hard to use or navigate around the site. Eventually I have to leave the website because of usability issues.

So with this in mind I decided to remove the share buttons from the excerpts in the homepage of my blog.

Remove Social Share Buttons from Jetpack in Excerpts

To do this you’ll need a code editor such as Editplus or Notepad++ so that you are able to comment out a line of code.

Here’s how:

  1. You need to find sharing-service.php, this is in public_html/wp-content/plugins/jetpack/modules/sharedaddy/
  2. at the end of the file you will find the bit to code to comment out or delete
  3. look for add_filter( ‘the_excerpt’, ‘sharing_display’, 19 ); and comment it out.

That will get rid of the social share buttons from each excerpt in the homepage.

Thanks for reading and please do leave your comments and suggestions.

 

By | 2013-01-06T23:36:18+00:00 December 1st, 2012|Plugins, Social, Tutorials|16 Comments

About the Author:

A Computing teacher by profession Abu teaches children aged 11-18. His background is in Computer Science. Currently writing for Top Islamic blog as the main editor. His passion is to disseminate computing and Islamic concepts to the willing ... Connect on Facebook.

16 Comments

  1. fazal 16/01/2013 at 4:49 pm - Reply

    Nice

  2. tutorial 10/02/2013 at 2:45 pm - Reply

    I do like Jetpack as it offers a lot of goods all built into one WordPress plugin Incidentally if you want to customise the Jetpack fixed theme then please read my step by step tutorial on how to edit Jetpack mobile Theme I don’t think we should be that desperate that we need to have excessive amounts of obtrusive e post.

  3. Antønio Falcão 11/02/2013 at 12:57 pm - Reply

    Thank you! Was looking for this for a while and it was a great help. Cheers!

  4. contadino 14/03/2013 at 8:44 am - Reply

    Thanks. Works a treat. Much appreciated.

  5. Brad 03/04/2013 at 12:48 am - Reply

    Sorry for the basic question. Can you tell me exactly what you’d put around that code to “comment it out?” Thank you for the help.

    • Abu Zainab 03/04/2013 at 1:48 am - Reply

      Hey Brad, two forward slashes // before the code comments it out.
      So when you find this: add_filter( ‘the_excerpt’, ‘sharing_display’, 19 );
      just add // before it so it looks like:
      //add_filter( ‘the_excerpt’, ‘sharing_display’, 19 );

      its not a basic question btw, thanks for your comment hope it helps! 🙂

      • Brad 06/05/2013 at 11:45 pm - Reply

        That worked perfectly! Thanks so much for the how-to, and making feel ok about asking the question. 🙂

  6. Craig Cacchioli 02/07/2013 at 11:23 am - Reply

    Is there a way to implement this in functions.php so that I don’t have to keep applying this fix with every Jetpack update?

  7. Daedal 27/07/2013 at 2:04 pm - Reply

    Hello,

    This post inspired me to create solution without editing core JetPack files since I also had this problem. Simple put this function in your functions.php (within theme directory) For some reason it doesn’t work by itself so I attached the function on init.

    `
    /**
    * Remove JetPack sharing buttons from post excerpt
    */

    add_action( ‘init’, ‘jp_remove_excerpt_share’ );

    function jp_remove_excerpt_share() {
    if ( has_filter( ‘the_excerpt’, ‘sharing_display’ ) ) {
    remove_filter( ‘the_excerpt’, ‘sharing_display’, 19 );
    }
    }
    `

    Cheers!

  8. sjmsing 28/05/2014 at 5:41 pm - Reply

    Thanks!

  9. Kirk Tab 26/11/2014 at 3:53 am - Reply

    This can also be done in CSS in the site’s child theme -use Firebug to identify the Share element on your post excerpt, then in the child theme’s style.css file add a style rule such as:
    .entry-summary div.sharedaddy {display:none;}
    Thus avoids hassles with re-appearance of share icons after Jetpack plugin upgrades.

    • Abu Zainab 29/11/2014 at 2:31 pm - Reply

      Thanks for your comment, I’m sure it’ll help someone.

  10. wisekal 20/01/2016 at 10:51 am - Reply

    This solution doesn’t appear to work anymore.

    • Pavlos 29/10/2016 at 1:12 pm - Reply

      This should work:

      /**
      * Remove JetPack sharing buttons from post excerpt
      */

      function jptweak_remove_share() {

      remove_filter( ‘the_excerpt’, ‘sharing_display’,19 );
      }
      add_action( ‘loop_start’, ‘jptweak_remove_share’ );

Leave a Comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.