Title: WordPress data compliancy
Last modified: February 17, 2025

---

# WordPress data compliancy

 *  [arjanwit](https://wordpress.org/support/users/arjanwit/)
 * (@arjanwit)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/wordpress-data-compliancy/)
 * Hi,
 * Is it possible to have the wp_members fields available in the Export en Delete
   Personal Data feature of WordPress? This way you cab easily comply with GDPR 
   regulations.
 * regards,
 * Arjan

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/wordpress-data-compliancy/#post-18310893)
 * I’ll add that to the feature update list for review.
 *  Thread Starter [arjanwit](https://wordpress.org/support/users/arjanwit/)
 * (@arjanwit)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/wordpress-data-compliancy/#post-18312542)
 * That would be awesome.
 * I added following code (with help from ChatGPT) but that fails the download of
   the Personal Data. Maybe in the mean-time you could take a look what is going
   wrong?
 *     ```wp-block-code
       // WP-Members user data exportfunction wpmem_personal_data_exporter( $exporters ) {    $exporters['wpmembers'] = array(        'exporter_friendly_name' => __( 'WP-Members Data' ),        'callback'               => 'wpmem_export_personal_data',    );    return $exporters;}add_filter( 'wp_privacy_personal_data_exporters', 'wpmem_personal_data_exporter' );function wpmem_export_personal_data( $email_address, $page = 1 ) {    $user = get_user_by( 'email', $email_address );    if ( ! $user ) {        return array(            'data' => array(),            'done' => true,        );    }    // Retrieve WP-Members user data    $user_data = wpmem_user_data( $user->ID );    $data_to_export = array();    // Export WP-Members custom fields (stored in usermeta)    $custom_fields = get_user_meta( $user->ID ); // Get all usermeta fields for the user        // Loop through each custom field and add it to the export    foreach ( $custom_fields as $key => $value ) {        // If the key starts with 'wpmem_' or any other prefix your fields have        if ( strpos( $key, 'wpmem_' ) === 0 ) {            $data_to_export[] = array(                'name'  => $key,                'value' => is_array( $value ) ? implode( ', ', $value ) : $value,            );        }    }    // Add the WP-Members data to the export    foreach ( $user_data as $key => $value ) {        $data_to_export[] = array(            'name'  => $key,            'value' => $value,        );    }    return array(        'data' => $data_to_export,        'done' => true,    );}
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress data compliancy’ is closed to new replies.

 * ![](https://ps.w.org/wp-members/assets/icon-256x256.png?rev=1226414)
 * [WP-Members Membership Plugin](https://wordpress.org/plugins/wp-members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-members/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-members/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [arjanwit](https://wordpress.org/support/users/arjanwit/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/wordpress-data-compliancy/#post-18312542)
 * Status: not resolved