When registering in wp, "wp hash password" is now used, and I need to have md5, as in the old fashioned way.

How to implement it?

ps: version vp last

  • Guys, if there are no options in this vein, then how can you implement sending the password in two columns? That is, password (this is hashing from wp) and passwordmd5 (this is an additional column) are acceptable - Danil Ekimov
  • VP does not store in md5, but understands it perfectly. When you login will change the hash. See for details.wordpress.org/support/topic/… - SeVlad

1 answer 1

Better not to do this. md5 has long been recognized as unsafe and obsolete. But if you really want, then you can. The wp_hash_password() function is pluggable and can be replaced with its own.

Create a plugin file wp-content/plugins/test-pluggable/test-pluggable.php and add the following code to it:

 <?php /** * Plugin Name: MD5 as Password Hash * Plugin URI: * Description: Test plugin to use MD5 as Password Hash * Author: KAGG Design * Version: 0.0.1 * Author URI: https://kagg.eu/en/ * Requires at least: 1.5.1 * Tested up to: 5.0 * * Text Domain: pwd-hash * Domain Path: /languages/ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Create a hash (encrypt) of a plain text password. * * @param string $password Plain text user password to hash * * @return string The hash string of the password */ if ( ! function_exists( 'wp_hash_password' ) ) { function wp_hash_password( $password ) { return md5( trim( $password ) ); } } 

Activate the plugin.