How To Remove Digg Digg Floating Share Bar From WooCommerce Products

How To Remove Digg Digg From WooCommerce ProductsI love the Digg Digg social sharing plugin for WordPress and put it on just about every site that I build (including this one).

It floats nicely down the page and is such a slick looking way to get people to interact with your blog posts on social media.

But there’s a couple of shortcomings with the plugin and the guys from Buffer (who now own the plugin) obviously don’t have a boat load of extra time dedicated to fixing them.

One such shortcoming is that it doesn’t handle custom post types very well, in particular for me the main annoyance was having Digg Digg’s floating share bar show on all WooCommerce product pages.

I came up with this short code snippet to get it to stop showing on any WooCommerce related page, feel free to use it in your functions.php:

function dd_exclude_from_woocommerce() {
	if(is_woocommerce()) {
		remove_filter('the_excerpt', 'dd_hook_wp_content');
		remove_filter('the_content', 'dd_hook_wp_content');
	}
}
add_action('template_redirect', 'dd_exclude_from_woocommerce');

Josh Kohlbach

Josh is a software entrepreneur from Brisbane, Australia. He spends most of his time helping e-commerce store owners. This is his personal blog where he shares his thoughts and other tidbits on online business and life in general.

This Post Has 7 Comments

  1. Hi Josh,

    You saved my life! I’m with you – I love Digg Digg but it doesn’t play well with Woocommerce.

    Thanks for sharing!

    All the best

    Steve

    1. Not a problem Steve 🙂 Glad it helped!

  2. where the functions.php file for editing?

    1. You’ll find it in your theme’s root directory wp-content/themes/your-theme/functions.php

  3. Thanks for that solution – it definitely helped me on my store.

Leave a Reply

Close Menu