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:
- You need to find sharing-service.php, this is in public_html/wp-content/plugins/jetpack/modules/sharedaddy/
- at the end of the file you will find the bit to code to comment out or delete
- 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.
Nice
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.
Thank you! Was looking for this for a while and it was a great help. Cheers!
You are welcome, glad it helped!
Thanks. Works a treat. Much appreciated.
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.
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! 🙂
That worked perfectly! Thanks so much for the how-to, and making feel ok about asking the question. 🙂
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?
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!
Brilliant. Works a treat!
Thanks!
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.
Thanks for your comment, I’m sure it’ll help someone.
This solution doesn’t appear to work anymore.
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’ );
I searched for hours on to find this answer thanks for sharing this! For those who still figure out how and where to place this code snippet, here’s what works for me:
Add the following code to your themes function.php:
/* Remove Jetpack Sharedaddy Sharing from post excerpts */
add_action( ‘init’, ‘remove_sharedaddy_excerpt_sharing’, 20 );
function remove_sharedaddy_excerpt_sharing() {
remove_filter( ‘the_excerpt’, ‘sharing_display’, 19 );
}