Advanced Custom Fields ACF Password field and MD5 Hashing

By North Street, A Creative Studio

ACF is great, but there can be some security concerns. Primary among them from front-end posting, is Passwords. If you ever find yourself using the “PASSWORD” ACF field type, make sure you hash it so you’re not storing the password as plain text!

It’s dead simple, drop this bit into functions.php

/* http://biostall.com/hashing-acf-password-type-fields-in-wordpress/ */
function ns_function_encrypt_passwords( $value, $post_id, $field  )
{
    $value = wp_hash_password( $value );
 
    return $value;
}
add_filter('acf/update_value/type=password', 'ns_function_encrypt_passwords', 10, 3);
About north street

We engineer the thoughtful transformation of great organizations. Our proven process helps us understand what your competitors are doing right — and wrong. Want to learn more? Let’s chat.

More Notes

Team Spotlight: Matt Potter, Web Designer

Postcards from Puerto Rico: North Street Retreat ’22

We’re Hiring: Marketing Coordinator