Third party plugins (yeah, including jetpack) are off topic on WPSE, but well, here you go: Jetpack has a filter jetpack_get_available_modules, which lets you edit the array of active modules. You can disable a module by unsetting it from the array, or enable it by adding it. Here’s how to enable a single module, ‘sharedaddy’:
function wpse248480_filter_jetpack( $modules, $min_version, $max_version ) {
if (!(in_array('sharedaddy',$modules))) $modules[] = 'sharedaddy';
return $modules;
}
add_filter( 'jetpack_get_available_modules', 'wpse248480_filter_jetpack', 20, 3 );
UPDATE
The above only filters the available modules. To actually (de)activate them programmatically use (source):
function wpse248480_activate_jetpack () {
Jetpack::activate_module('sharedaddy');
// Jetpack::deactivate_module('sharedaddy');
}
add_action('after_setup_theme','wpse248480_activate_jetpack');
Related Posts:
- How to disable Jetpack modules such as Stats?
- Cannot activate Jetpack on my server
- Jetpack Infinite Scrolling For Multiple Columns On Same Page?
- Popular posts by view with Jetpack
- Gravatar Hovercards (Jetpack) jQuery error
- Jetpack – stats_get_csv period parameter
- Using stats_get_csv to return a list of popular posts by views with thumbnails
- How do I update the site URL used by Jetpack subscribe widget [closed]
- Isotope with Infinite Scroll
- Jetpack infinite scroll not working on Twenty Twelve [closed]
- Can’t connect to my WordPress website using Windows 8 app?
- What does this number represent in JetPack stats? [closed]
- I have a self hosted blog but now the WordPress.com stats plugin has stopped working
- jetpack suddendly stopped working [closed]
- Jetpack social icons in other places on site
- Why I can’t modified jetpack default blank.jpg on og:image?
- How to remove WordPress’ Jetpack plugin completely? [duplicate]
- How do I remove quantcast from my sites?
- Customizing JetPack Publicize Sharing
- Jetpack infinite scroll not working on twentysixteen custom theme
- Change $content_width based on screen size (functions.php)
- Jetpack button location buffering [closed]
- Does Jetpack conflicts with load_template()?
- Hide Jetpack for Contributor [closed]
- How do i import email addresses into WordPress.com subscriptions? [closed]
- Hiding Jetpack Ads from users who are signed in?
- Jetpack Infinite Scroll – changing number of posts
- How to allow users to write jetpack custom post types? [closed]
- Missing Jetpack Contact Form button when running locally [closed]
- Why does Jetpack insert it’s script outside the tag?
- Updating shortlinks from staging [closed]
- Jetpack Publicize and Android
- How can I get the Jetpack Image plugin to open links in a new window? [closed]
- Infinite Scroll on Self-hosted WordPress [closed]
- How to remove Stats by jetpack dashboard widget?
- Publicize in Jetpack stopped working on Custom Post Type it works in Blog Posts
- Jetpack Top post widget (display post views)
- Unable to setup jetpack on my site
- Where does Jetpack store markdown?
- The plugin jetpack/jetpack.php has been deactivated due to an error: Plugin file does not exist
- Jetpack URL shortening, fixing after website URL change
- Infinite scroll function for Twenty Seventeen
- how to disable jetpack for non admins?
- Popular posts – based on pageviews
- Implementing backbone.js to retrieve category posts using JSON API
- Jetpack email sharing button to include image on email sent
- Pageview confusion [closed]
- Jetpack Infinite Scroll, Isotope and ImagesLoaded
- Force Jetpack to not use og:image tag for favicon / Site Icon [closed]
- Using Jetpack to track an Ajax powered blog [closed]
- Jetpack: Access visitor stats in templete
- Generate Sitemap after removing JetPack
- When would it make sense to use Jetpack?
- Slow REST API calls on self-hosted WordPress [closed]
- How to tell if Jetpack’s Photon is active?
- Custom Loop and Infinite Scroll
- Moving sharedaddy buttons (in Jetpack) to the top of a post?
- Customise Jetpack Publicize text
- Custom post metadata not appearing in public API
- Jetpack Infinite scroll conflicting with theme’s pre_get_posts custom posts_per_page
- How can I show the Jetpack Subscriptions form in a page? [closed]
- JetPack Infinite Scroll not working on custom theme
- API for Post Stats for Self-Hosted WordPress using JetPack [closed]
- Is it safe to delete uploaded photos if Photon (Jetpack) is activated?
- Facebook Like Button in Jetpack [closed]
- Removing the main link to Jetpack from the menu
- How to change the position of Jetpack sharing icons? [closed]
- Child Theme vs. Jetpack Editor
- stats_get_csv (WordPress Stats) to only display top posts (not pages)
- Removal of Jetpack OG Tags from old blog site
- Jetpack Infinite Scroll – Add more than 7 posts each time?
- how to get jetpack’s infinite scroll to work with woocommerce?
- Incorrect url for sharing blog on linkedin [closed]
- strange behavior with comment position
- Custom CSS at Appearance > Edit CSS is missing after update [closed]
- Using Jetpack carousel w/o creating a gallery [closed]
- Jetpack CSS .screen-reader-text breaks mobile menu [closed]
- When someone likes an article on my blog, they are prompted to log in on WordPress.com [closed]
- Cropping images from top center using Jetpack Photon
- Sharing Buttons not Working – Sharing Settings [closed]
- Jetpack stats and caching strategy [closed]
- JetPack comment threads are displaying above comment box? [closed]
- Jetpack: Subscribe via e-mail [closed]
- Shortcode not working in Jetpack Top Posts & Pages widget
- Jetpack Lazy load images fade in
- the_content filter not working when Jetpack activated. Any idea?
- Register CPT if Jetpack Portfolio is not active and only once
- mydomain.com/wp-login redirects to wordpress.com/wp-login
- How do plugin updates work?
- Jetpack Mobile Theme: when on smartphone on categories the theme suddenly changes to jetpack mobile theme even though it’s deactivated
- How can I stop Jetpack mobile theme from using full size featured images?
- Visual Editor not working when Jetpack plugin is active
- Can’t publish posts, Jetpack won’t connect, empty notification emails to my inbox [closed]
- I’m think I’ve found a bug with JetPack 1.7 [closed]
- How to delete Jetpack Widgets from the Widgets page in admin panel [closed]
- How To Remove The Filter That Adds JetPack Related Content To Dom [closed]
- Jetpack ‘Blog Subscription’ widget doesn’t add emails to
- Delete old JetPack Site Stats? encrypted_search_terms in top search terms [closed]
- Questions about using Disqus or Jetpack for comments [closed]
- Footnotes with dynamic title attributes?