# Hide Jetpack Sharing Buttons on Selected Content

> Turns off Jetpack's sharing buttons on chosen post types, categories or individual posts, such as landing pages, legal pages or members-only content.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: jetpack, sharing, conditional
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/jetpack-hide-sharing-by-type/

## Code

```php
$wpide_hide_types = array( 'page' );       // Post types.
$wpide_hide_cats  = array( 'members' );    // Category slugs.
$wpide_hide_ids   = array();               // Post IDs.

add_filter( 'sharing_show', function ( $show, $post ) use ( $wpide_hide_types, $wpide_hide_cats, $wpide_hide_ids ) {
    if ( ! $show || ! $post instanceof WP_Post ) {
        return $show;
    }

    if ( in_array( $post->post_type, $wpide_hide_types, true ) || in_array( (int) $post->ID, array_map( 'absint', $wpide_hide_ids ), true ) ) {
        return false;
    }

    if ( $wpide_hide_cats && has_category( $wpide_hide_cats, $post ) ) {
        return false;
    }

    return $show;
}, 10, 2 );
```

## Notes

Fill in any of the three lists; leave a list empty to skip that rule.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Jetpack Sharing Buttons on Selected Content" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
