Add/Update a Plugin or Theme using .zip with API?


Is this possible ? I want to update and install plugins & themes using the API, but it seels this only for the plugins that are on wp.prg!

Hey @adil

Welcome to the MainWP community.

It is not possible to install or update plugins or themes using a ZIP file with REST API.

However, if a premium plugin or theme has an active license and can normally be updated from the Updates page, it will also be possible to update it via REST API.

The issue is the plugin/theme I want to update didn’t have auto update before, now the DEVs enable it and it will take time to do it for all +100 sites :frowning: Because I was thinking using the API I can get all sites that have that specific plugin/theme, upload it to them, and then in the future it will managed (the updates) from dashboard.

Aren’t any work arounds for this :innocent: ?

Not via REST API since it doesn’t support file uploads, however you can manually install that ZIP using MainWP Dashboard as explained here: Install Plugins by Upload - MainWP Documentation

And you can follow this guide to install that ZIP file to the site that already have the plugin installed: How to install a plugin on sites that already have a certain plugin installed - MainWP Documentation

After that, if the available updates for that plugin appear in the Child Site’s wp-admin/update-core.php page, the MainWP Dashboard will also display an available update.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.