Skip to content

Instantly share code, notes, and snippets.

@andrii-kvlnko
Created May 28, 2021 21:57
Show Gist options
  • Save andrii-kvlnko/bd01b4a849ea94dff6d365dd4f1749c0 to your computer and use it in GitHub Desktop.
Save andrii-kvlnko/bd01b4a849ea94dff6d365dd4f1749c0 to your computer and use it in GitHub Desktop.
How to remove malware from WordPress website?
<?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