Created
January 27, 2022 15:43
-
-
Save coffebar/1e1b2ebe7f36e11fbbc899f385c6fcdc to your computer and use it in GitHub Desktop.
WordPress cli gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
alias wp="php ~/wp-cli.phar" | |
DOMAIN=localhost | |
wp core download | |
wp core config --dbname=wordpress \ | |
--dbuser=wordpress \ | |
--dbpass="wordpressDbPass" \ | |
--dbhost=localhost \ | |
--dbprefix="wp1_" | |
wp core install --url="$DOMAIN" \ | |
--title="Site Name" \ | |
--admin_user="wordpress" \ | |
--admin_password="AdminPassword" \ | |
--admin_email="[email protected]" | |
# install and activate plugin: all-in-one-seo-pack | |
wp plugin install all-in-one-seo-pack --activate | |
# delete demo post | |
wp post delete 1 | |
# disable emoji | |
wp option update use_smilies 0 | |
# disable comments | |
wp option update default_comment_status "closed" | |
# show a page [id=2] on the home page | |
wp option update page_on_front 2 | |
wp option update show_on_front page | |
# update post text | |
wp post update 2 --post_type=page --post_content="Hello world!" --post_title="WP CLI is awesome" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment