Skip to content

Instantly share code, notes, and snippets.

@chrisjangl
Created November 24, 2021 12:30
Show Gist options
  • Save chrisjangl/ab012872b870d6a0ad716863da93817d to your computer and use it in GitHub Desktop.
Save chrisjangl/ab012872b870d6a0ad716863da93817d to your computer and use it in GitHub Desktop.
Working from a list of WordPress sites on a shared hosting environment (sites.txt), create a report of the admin email for each. Includes a link to the settings page to update the value.
i=1
touch admin-email.txt
COUNT=$(wc -l sites.txt)
for SITE in $(cat sites.txt)
do
cd $SITE
echo "Working on $SITE ($i of $COUNT)..."
echo "## $SITE" >> ../admin-email.txt
url=$(wp option get siteurl)
postURL="/wp-admin/options-general.php"
admin_email=$(wp option get admin_email)
echo "admin email: $admin_email" >> ../admin-email.txt
echo " if that's not what you want, you can change it here: $url$postURL" >> ../admin-email.txt
echo "----------------" >> ../admin-email.txt
echo " " >> ../admin-email.txt
echo " " >> ../admin-email.txt
echo " " >> ../admin-email.txt
((i=i+1))
clear
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment