exist WordPress In the course of development or maintenance, we often come across premium plugins or themes from third parties, which usually start as .zip Instead of getting them directly from the official wordpress.org repositories, the zip files are provided in the form of files. In this case, installing these zip files with the help of WP-CLI will be much more efficient.
In this article, we will explain in detail how to use the WP-CLI The complete process of installing plugins and themes in local or remote zip file format.
![图片[1]-使用 WP-CLI 安装 WordPress 插件和主题 ZIP 文件教程](https://www.361sale.com/wp-content/uploads/2025/07/20250710094241222-image.png)
Prerequisites: WP-CLI installed on the server
Before you start, please make sure that WP-CLI is installed in your server environment. if it is not, please refer to another article: [How to Install WP-CLI on Linux]
Step 1: Go to the WordPress installation directory
First, use the terminal (CLI) to go to the WordPress installation directory. For example, if your site is located:
web/wpgan.tld/public_html
The catalog can be accessed using the following command:
cd web/wpgan.tld/public_html
![图片[2]-使用 WP-CLI 安装 WordPress 插件和主题 ZIP 文件教程](https://www.361sale.com/wp-content/uploads/2025/07/20250710094313669-image.png)
Step 2: Create a temporary folder for storing the zip file
After entering the WordPress root directory, it is recommended to create a temporary folder (e.g. tmp) to store the downloaded zip file:
mkdir tmp
cd tmp
![图片[3]-使用 WP-CLI 安装 WordPress 插件和主题 ZIP 文件教程](https://www.361sale.com/wp-content/uploads/2025/07/20250710094320712-image.png)
Step 3: Add the plugin or theme zip file
You can use the wget,curl maybe FTP Upload by placing the zip file in the folder. Example:
Add plugin (Ezsha plugin):
wget https://github.com/mnasikin/Ezsha/archive/refs/heads/main.zip
Add theme (Hello Elementor example):
wget https://downloads.wordpress.org/theme/astra.4.7.0.zip
After the download is complete, you can use the ls command to confirm that the zip file was downloaded successfully:
ls
![图片[4]-使用 WP-CLI 安装 WordPress 插件和主题 ZIP 文件教程](https://www.361sale.com/wp-content/uploads/2025/07/20250710094340820-image.png)
Step 4: Install the plugin or theme zip file
Return to the WordPress installation directory:
cd ...
Installation of plug-ins
wp plugin install tmp/main.zip
If you wish to enable the plugin directly after installation, you can add the --activate Parameters:
wp plugin install tmp/main.zip --activate
Install Theme
commander-in-chief (military) plugin Replace with theme Ready to go:
wp theme install tmp/astra.4.7.0.zip --activate
After successful installation, the terminal will return a message indicating that the plugin or theme has been installed and activated correctly.
![图片[5]-使用 WP-CLI 安装 WordPress 插件和主题 ZIP 文件教程](https://www.361sale.com/wp-content/uploads/2025/07/20250710094351337-image.png)
summarize
utilization WP-CLI Installing plugins and themes in zip format is efficient, clean and suitable for developers and project management in VPS environments. If you want to install plugins or themes directly from the official WordPress repositories, you can also read our other tutorials:
Link to this article:https://www.361sale.com/en/66682/The article is copyrighted and must be reproduced with attribution.


















![表情[wozuimei]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![表情[baoquan]-光子波动网 | WordPress教程、Elementor教程与故障修复](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments