Monthly Archives: June 2012

Remove ShareThis Buttons From Post Excerpts

This is for the ShareThis WordPress plugin found at http://wordpress.org/extend/plugins/share-this/

In your theme’s functions.php file you’ll want to input the following code…

 remove_filter( 'get_the_excerpt', 'st_remove_st_add_link', 9 );
 remove_filter( 'the_excerpt', 'st_add_widget' );

This will remove the buttons from displaying on pages like the homepage, search results, category pages, etc etc. That is, assuming that your theme is coded to use the_excerpt() in template files.

If you only want to remove the buttons from say the homepage of your site, you could do something like…

if ( is_home() || is_front_page() ) {
remove_filter( 'get_the_excerpt', 'st_remove_st_add_link', 9 );
remove_filter( 'the_excerpt', 'st_add_widget' );
}