# Download WordPress
wp core download --locale=ru_RU
# Generate wp-config.php:
wp core config --dbname=NAME --dbuser=USER --dbpass=PASS --dbprefix=wp_
# Create DB (based on wp-config.php)
wp db create
# Install WP to created DB
wp core install --url=example.com --title=Example --admin_user=supervisor \
[email protected] --admin_password=strongpassword
# List posts:
wp post list
# Edit post:
wp post edit 1
# Post update:
wp post update 1 --post_title="Your New title..."
# Create posts:
wp post create --post_status=publish --post_title="Second Post" --edit
# See all metas of post 18:
wp post meta list 18
# Get post meta value:
wp post meta get 18 meta_name
# Delete post meta by key:
wp post meta delete 18 meta_name
# Create DB dump
wp db export - --add-drop-table --default-character-set=utf8mb4 | gzip > ./db_backup-$(date +%Y-%m-%d-%H%M%S).sql.gz
# Insert data from DB dump to DB
wp db import db_backup-2022-01-20.sql
# Login WordPress db:
wp db cli
# Run SQL Query:
wp db query "SELECT user_login, ID FROM wp_users;"
# Optimize db:
wp db optimize
# Update WordPress
wp core update
# Update all plugins:
wp plugin update --all
# List plugins:
wp plugin list
# Search plugin:
wp plugin search yoast
# Install plugin:
wp plugin install yoast
# List installed themes:
wp theme list
# Install theme:
wp theme install twentyone
# Activate theme:
wp theme activate twentyone