Title: Cleaning Data from CSV
Last modified: May 26, 2020

---

# Cleaning Data from CSV

 *  Resolved [s00001000](https://wordpress.org/support/users/s00001000/)
 * (@s00001000)
 * [6 years ago](https://wordpress.org/support/topic/cleaning-data-from-csv/)
 * Does anyone have experience cleaning data during the import? For example, extracting
   a file name from a non-cleaned URL and appending it to a clean URL. Is this possible?

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

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [6 years ago](https://wordpress.org/support/topic/cleaning-data-from-csv/#post-12918719)
 * Hi [@s00001000](https://wordpress.org/support/users/s00001000/)
 * > For example, extracting a file name from a non-cleaned URL and appending it
   > to a clean URL. Is this possible?
 * You could use a PHP function to do that: whttps://www.wpallimport.com/documentation/
   developers/custom-code/inline-php/. Here’s an example function that you can modify
   as needed:
 *     ```
       function my_fix_imageurl( $imageurl ) {
           $new_url        = 'https://example.com/';
           $image_name     = basename( $imageurl );
           $new_image_url  = $new_url . $image_name;
   
           return $new_image_url;
       }
       ```
   
 * You’ll also find a lot more examples here: [https://www.wpallimport.com/documentation/developers/code-snippets/](https://www.wpallimport.com/documentation/developers/code-snippets/).
 *  Thread Starter [s00001000](https://wordpress.org/support/users/s00001000/)
 * (@s00001000)
 * [6 years ago](https://wordpress.org/support/topic/cleaning-data-from-csv/#post-12922485)
 * Resolved – thanks.

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

The topic ‘Cleaning Data from CSV’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [data manipulation](https://wordpress.org/support/topic-tag/data-manipulation/)

 * 2 replies
 * 2 participants
 * Last reply from: [s00001000](https://wordpress.org/support/users/s00001000/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/cleaning-data-from-csv/#post-12922485)
 * Status: resolved