Title: Bulk adding confusion
Last modified: May 5, 2023

---

# Bulk adding confusion

 *  Resolved [devilmakq](https://wordpress.org/support/users/devilmakq/)
 * (@devilmakq)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/bulk-adding-confusion/)
 * Hello, I want to follow the steps here – [https://wordpress.org/support/topic/add-new-adresses-via-php/](https://wordpress.org/support/topic/add-new-adresses-via-php/)
   
   I can add the php using custom snippet plugin.Could you help me know what to 
   type in /Fill in your address/, I would appreciate if you show me the code to
   add 2-3 address as I have to add around 50 address.And also can I remove the 
   php after it adds the addresses?

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

 *  Plugin Author [Matt Harrison](https://wordpress.org/support/users/matt-h/)
 * (@matt-h)
 * [3 years ago](https://wordpress.org/support/topic/bulk-adding-confusion/#post-16784467)
 * Addresses should be an array of addresses like:
 *     ```wp-block-code
       $addresses = array(
       			array(
       				'first_name' => 'John',
       				'last_name' => 'Doe',
       				'company' => 'WooCommerce',
       				'address_1' => '123 Fake Street',
       				'address_2' => 'Floor 1',
       				'city' => 'San Francisco',
       				'state' => 'CA',
       				'postcode' => '90210',
       				'country' => 'US',
       			),
       			array(
       				'first_name' => 'Jane',
       				'last_name' => 'Doe',
       				'company' => 'Google',
       				'address_1' => '123 Fake Street',
       				'address_2' => 'Floor 1',
       				'city' => 'San Francisco',
       				'state' => 'CA',
       				'postcode' => '90210',
       				'country' => 'US',
       			),
       		);
       ```
   
 * You could also parse them out from a csv file with some code using fgetcsv
 * This would all be code you just run one time to do the import to the database
   then you should remove the code otherwise it would import new addresses every
   time it runs.
 * One difference from that previous example is the last line would be different
   than it was 4 years ago. Use one or the other for billing or shipping addresses:
 *     ```wp-block-code
       update_user_meta( $user_id, 'wc_address_book_billing', $address_names );
   
       update_user_meta( $user_id, 'wc_address_book_shipping', $address_names );
       ```
   
 *  Plugin Author [Matt Harrison](https://wordpress.org/support/users/matt-h/)
 * (@matt-h)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/bulk-adding-confusion/#post-16963427)
 * We just released a new version of the plugin that supports uploading addresses.
   When you are running version 3+ you can turn on import/export in the settings
   and then you are able to export and import CSVs on the My Account page.

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

The topic ‘Bulk adding confusion’ is closed to new replies.

 * ![](https://ps.w.org/woo-address-book/assets/icon-256x256.png?rev=2950910)
 * [Address Book for WooCommerce](https://wordpress.org/plugins/woo-address-book/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-address-book/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-address-book/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-address-book/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-address-book/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-address-book/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Matt Harrison](https://wordpress.org/support/users/matt-h/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/bulk-adding-confusion/#post-16963427)
 * Status: resolved