原來 批量管理 wordpress 比想像中的簡單

wordpress 更新的速度,真的快,畢竟全球麼多人在用,駭客也在盯這塊,光是我自己的wordpress,就被跑進來駭了好幾次。

wordpress 可以更新的東西很多,主體,插件,佈景和與言包等等。

之前都是土法煉鋼去更新一個wordpress,再用shell指令去更新

今天在做外掛開發時,看到文件,有一些事情,其實用WP CLI會更容易一下,CLI,就是指令界面,目前有幾個網站寄存(hosting)大廠在維護。

安裝在這裡 https://wp-cli.org/
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
wp –info 可以得到wordpress 相關資訊

更新套件指令
wp plugin update –all

更新佈景主題指令
wp theme update –all

更新語言包的方式就要做三塊 core:wordpress 系統的翻譯,其中 plugin / theme 又可單獨對外掛或是佈景主題做翻譯更新
所以指令如下
wp language core update
wp language plugin update –all
wp language theme update –all
合件一起的大平台一行指令
wp language core update;wp language plugin update –all;wp language theme update –all

更新 整個 wordpress 指令如下
wp core update

像我是用管理者做更新,所以再加上 –allow-root 參數

下载
资源
0

隨機文章

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *