Skip to content

Instantly share code, notes, and snippets.

@bacoords
bacoords / pull.sh
Created January 18, 2025 18:35
Pull production database and wp-content into your local environment with WP-CLI
#!/bin/bash
# Configuration variables - replace with your values
REMOTE_HOST="[email protected]"
REMOTE_PATH="files"
LOCAL_PATH="wp-content"
# Database name
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
DB_BACKUP="wp_backup_${TIMESTAMP}.sql"
@bacoords
bacoords / installwp.sh
Created March 23, 2025 14:43
Bash script for setting up local WP
#!/bin/bash
# Credit to https://github.com/rizaardiyanto1412/rizaardiyanto1412/blob/main/installwp.sh
# Check if WP-CLI is installed
if ! command -v wp &> /dev/null
then
echo "WP-CLI is not installed. Please install it first."
exit 1
fi