### Remove "dry-run" to write the changes to the DB!
### Run "wp db export" to back up DB first!
DO NOT BLINDLY COPY AND PASTE THESE, CHANGE THE DIRECTORY PATHS IN THEM FIRST!
# Standard WP Single Sites
wp search-replace "//local.dev/clients/drawcard/www" "//example.com" --recurse-objects --skip-columns=guid --dry-run
wp search-replace "/var/www/public/clients/drawcard/www" "/home/useraccount/public_html" --recurse-objects --skip-columns=guid --dry-run
# Network / Multisites
wp search-replace --url=http://local.dev/clients/drawcard/www "//local.dev/clients/drawcard/www" "//example.com" --recurse-objects --network --skip-columns=guid --dry-run
wp search-replace --url=http://local.dev/clients/drawcard/www "/home/useraccount/public_html" "//example.com" --recurse-objects --network --skip-columns=guid --dry-run
From this StackOverflow answer
cd /var/www
sudo gpasswd -a "$USER" www-data
sudo chown -R "$USER":www-data .
sudo find . -type f -exec chmod 0660 {} \;
sudo find . -type d -exec chmod 2770 {} \;
sudo chmod -R g+s . #set defaults for future files & folders
wp user create [username] [[email protected]] --role=administrator
wp user list # Lookup the user's ID
wp user update [userid] --display_name=[username] --user_pass=[newpassword]
# Copy and paste this whole block into terminal.
wp plugin install --activate https://github.com/afragen/github-updater/archive/develop.zip `# Github Plugin Updater`
wp plugin install --activate https://github.com/wp-sync-db/wp-sync-db/archive/master.zip `# WP Sync DB`
wp plugin install --activate https://github.com/wp-sync-db/wp-sync-db-media-files/archive/master.zip `# WP Sync DB Media Files Addon`
wp plugin install --activate wordfence `# Wordfence`
wp plugin install --activate elementor `# Elementor (install the Pro plugin manually from www.elementor.com/pro)`
wp plugin list
Kill all yarn processes; run a build && run a watch command
pkill node ; yarn run build:production && yarn run start &
For Digital Ocean site:
"publicPath": "/wp-content/themes/sage-clientname/",
"devUrl": "https://drawcard.site/clientname/",
"proxyUrl": "https://drawcard.site:3000/clientname",
# If not already done so, get the useful "mellon" script
git clone https://github.com/drawcard/mellon ~/.mellon
echo "alias mellon='sh ~/.mellon/mellon'" >> ~/.bash_aliases
source ~/.bashrc
# Generate a htpasswd & htaccess combo
cd /path/to/wp/folder
mellon foobar #foobar is the username you wish to create
# Answer the prompts with a password of your choice