Skip to content

Instantly share code, notes, and snippets.

@coffebar
Created January 27, 2022 15:43
Show Gist options
  • Save coffebar/1e1b2ebe7f36e11fbbc899f385c6fcdc to your computer and use it in GitHub Desktop.
Save coffebar/1e1b2ebe7f36e11fbbc899f385c6fcdc to your computer and use it in GitHub Desktop.
WordPress cli gist
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="salta.inbox@gmail.com"
# 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