Skip to content

Instantly share code, notes, and snippets.

@loorlab
Last active March 28, 2024 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loorlab/b08a2bb9e1df3b4c1f27a5673b917b06 to your computer and use it in GitHub Desktop.
Save loorlab/b08a2bb9e1df3b4c1f27a5673b917b06 to your computer and use it in GitHub Desktop.
WordPress with WP-CLI

Install WordPress - Folder : /blog/

mkdir blog
cd blog
wp core download

Create wp-config.php

wp core config --dbname=test_db --dbuser=test_user --dbpass=password_user --dbhost=localhost --dbprefix=prefix_

Create Users

 wp user create user user@example.com --role=administrator --user_pass=password 

Install Theme : 'short-news' --> https://wordpress.org/themes/short-news/

 wp theme install short-news --activate

Install Plugin : 'WordPress Importer'

wp plugin install --activate wordpress-importer

List Users

wp user list

Delete Users

wp user delete user

Refresh Permalinks with WP-CLI

wp rewrite flush

wp rewrite structure '/%postname%'

WordPress Version

wp core version

WordPress Plugin List

wp plugin list

Update WordPress

wp core update

wp core download --version=6.2.2 --force

Update Plugins

wp plugin update --all

Verify Checksums

wp core verify-checksums

Reinstall using version and locale skipping the content folder (wp-content)

wp core download --force --skip-content --locale=en_US --version=6.4.3

Displays the database table prefix

wp db prefix

@loorlab
Copy link
Author

loorlab commented May 14, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment