使用WP-CLI可以避免一些情况下在线升级WordPress失败的问题。
安装WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
#查看命令详情
wp --info
#更新WP-CLI
wp cli update
基础命令
安装WordPress
wp core download
升级核心文件
wp core update --allow-root
更新数据库
wp core update-db --allow-root
更新语言
wp language core update --allow-root
查看WordPress当前版本
wp core version --allow-root
插件相关命令
列出安装的插件
wp plugin list --allow-root
查看插件状态
wp plugin status --allow-root
激活插件
wp plugin activate [plugin_name] --allow-root
搜索插件
wp plugin search [plugin_name] --allow-root
安装插件
wp plugin install [plugin_name] --allow-root
激活插件
wp plugin activate [plugin_name] --allow-root
更新插件
wp plugin update --all --allow-root
wp plugin update [plugin_name] --allow-root
主题相关命令
列出安装的主题
wp theme list --allow-root
搜索主题
wp theme search [theme_name] --allow-root
安装主题
wp theme install [theme_name] --allow-root
更新主题
wp theme update [theme_name] --allow-root
激活主题
wp theme activate [theme_name] --allow-root
删除主题
wp theme delete [theme_name] --allow-root
留言板