WP Theme Plugin Download

By Abhay Yadav

★ 5.0/5 (14 ratings)2,000+ active installationsVersion 1.5.0

Download any installed plugin or theme as a .zip from the WordPress admin, ready to install on another site.

Description

Adds a Download link to the Plugins and Themes screens so you can export an installed plugin or theme as a .zip file and install it on another site.

  • Download plugins from the Plugins screen (including must-use plugins).
  • Download themes from Appearance > Themes (and the Network Themes screen on multisite).
  • No settings. Activate and use.

Security

  • Only users who can activate plugins (for plugins) or switch themes (for themes) see the link and can download.
  • Every download link carries a nonce tied to that specific plugin or theme.
  • Only items WordPress reports as installed can be downloaded.
  • The archive is built in the system temporary directory, not in the public uploads folder, and deleted right after download.

Use the ab_wtpd_capability filter to change the required capability.

Requirements

WordPress 5.0+, PHP 7.4+. The PHP zip extension is used when available, with a fallback to the PclZip library bundled with WordPress.

Installation

  1. Upload the plugin folder to /wp-content/plugins/, or install it from Plugins > Add New.
  2. Activate the plugin.
  3. Use the new Download link on the Plugins or Themes screen.

FAQ

Who can download plugins and themes?

Users with the activate_plugins capability (plugins) or switch_themes capability (themes). Change this with the ab_wtpd_capability filter.

The Download button does not show on the Themes screen.

The button is added by patching WordPress’s theme templates in the browser. If your theme-browser markup is customised or a plugin replaces it, the button may not appear. The link on the Network Themes screen (multisite) is unaffected.

Does it include symlinks?

Symlinked files and folders inside a plugin or theme are skipped.

Screenshots

Changelog

1.5.0

  • Security: require a capability check and an item-specific nonce before any download.
  • Security: only installed plugins and themes can be downloaded (allowlist instead of filename sanitising).
  • Security: build the zip in the system temp directory instead of the public uploads folder.
  • Use admin-post.php instead of handling requests on plugins_loaded.
  • Use ZipArchive when available, with PclZip as a fallback; handle failures and single-file plugins.
  • Send Content-Length, clean output buffers before streaming, and remove the temp file on shutdown.
  • Rewrite the Themes screen button without jQuery’s removed .load() and without per-theme URL parsing.
  • Add text domain, translation-ready strings, modern plugin headers and a class-based structure.
  • Requires WordPress 5.0+ and PHP 7.4+.

1.4

  • Compatibility update.

1.3

  • Initial release.