使用WP-CLI管理WordPress
source link: https://easeapi.com/blog/blog/138-wp-cli.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
WP-CLI是用于管理WordPress的控制台命令行工具,可以方便的执行WordPress站点升级,管理插件/主题/翻译等,使用WP-CLI运维WordPress站点可以极大提升效率。本文整理了WP-CLI的常见命令。
使用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
https://wp-cli.org
WordPress安装及基本配置
使用CDN提升网站访问速度
linux后台任务执行
优化Nginx配置提升网站性能
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK