Created
May 28, 2021 21:57
-
-
Save andrii-kvlnko/bd01b4a849ea94dff6d365dd4f1749c0 to your computer and use it in GitHub Desktop.
How to remove malware from WordPress website?
This file contains hidden or 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 | |
add_action( 'init', function () { | |
if ( ! isset( $_GET['update-user-passwords'] ) ) { | |
return; | |
} | |
$new_password = 'your-new-password'; | |
$users = get_users(); | |
foreach ( $users as $user ) { | |
$user = new WP_User(); | |
wp_set_password( $new_password, $user->ID ); | |
} | |
echo "All user's passwords changed to new one" | |
exit; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment