Title: Improve export users
Last modified: January 1, 2017

---

# Improve export users

 *  Resolved [Lafare](https://wordpress.org/support/users/lafare/)
 * (@lafare)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/improve-export-users/)
 * Hello,
 * I’ve been using that plugin for a while and it proves to be very useful and reliable.
 * I’ve remarked a problem occuring on fields like first_name, last_name,… If their
   value contains a special character like “&” it is expanded by WP to & (during
   the process of updating first_name meta – using filter : pre_user_first_name).
 * When the field is exported back by the WP-MEMBERS it contains the expanded entity
   rather than the original value.
 * If you could uses html_entity_decode when getting those meta, it would lead to
   a cleaner exported file.
 * I’ve patched your code – user_export.php line 103 (v.3.1.6.3) like below:
 * `$data .= '"' . html_entity_decode(get_user_meta( $user, $meta, true )) . '",';`
 * It seems to make the job – I let you check and decide if it could be added in
   a next version.
 * Best regards.

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

 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/improve-export-users/#post-8610921)
 * That’s a possibility. I’ll need to evaluate it before saying for sure. My primary
   concern would if unsafe data were escaped when going into the user data, this
   could be a potential problem bringing it out. However, since it is being streamed
   as a CSV, that may not necessarily be exploitable.
 *  Thread Starter [Lafare](https://wordpress.org/support/users/lafare/)
 * (@lafare)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/improve-export-users/#post-8611019)
 * I understand your concern, you have no mean to know if the espaced data come 
   from the original value of the field or were created by wordpress. May be a config
   option could let the plugin user decide which behaviour he wishes.
    -  This reply was modified 9 years, 5 months ago by [Lafare](https://wordpress.org/support/users/lafare/).
 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/improve-export-users/#post-8618194)
 * I like the idea and I want to work it in. It will probably start as a filterable
   option.
 * There is a $defaults array in the beginning of the function that has some elements
   that allow customizing the processing – file name, fields, excluded fields. To
   start out with, it will likely be added to that group.
 * My initial go with this would be to add “entity_decode” as part of that array.
   This would be a true|false boolean. Starting out, it will default to false.
 * Switching it on could be done as follows:
 *     ```
       add_filter( 'wpmem_export_args', function($args) {
           $args['entity_decode'] = true;
           return $args;
       });
       ```
   
 * The file with proposed changes is available as a gist for testing here:
    [https://gist.github.com/butlerblog/59ae104ed63d84821ec2f4b0bdcbba43](https://gist.github.com/butlerblog/59ae104ed63d84821ec2f4b0bdcbba43)
 * Please give it a test run. I’ve scheduled this for adding to the 3.1.7 release
   that is in development.
 *  Thread Starter [Lafare](https://wordpress.org/support/users/lafare/)
 * (@lafare)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/improve-export-users/#post-8620692)
 * I had a try to it, it works as expected in my case.
    Thank you for the patch.

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

The topic ‘Improve export users’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [Lafare](https://wordpress.org/support/users/lafare/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/improve-export-users/#post-8620692)
 * Status: resolved