Created
May 31, 2014 09:23
-
-
Save adrian7/f047791b54be335eb7f1 to your computer and use it in GitHub Desktop.
Changes admin_email for a wordpress site; in case you don't have wp-admin access but you have FTP access to it
This file contains 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
<?php | |
include_once 'wp-load.php'; global $wpdb; echo '<pre>'; | |
$SelectSQL = $wpdb->prepare("SELECT * FROM $wpdb->options WHERE `option_name`='admin_email'"); | |
$Row = $wpdb->get_row($SelectSQL); | |
print_r($Row); | |
if( isset($_GET['email']) ){ | |
$UpdateSQL = $wpdb->prepare("UPDATE $wpdb->options SET `option_value`= %s WHERE `option_name`='admin_email'", $_GET['email']); | |
$updated = $wpdb->query( $UpdateSQL ); | |
if( $updated ) | |
echo "\nUpdated"; | |
else | |
echo ( "\nError: " . $wpdb->print_error() ); | |
} | |
else echo 'Usage: /adminemail.php?email=newadmin@website.com'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment