Title: Importing Data
Last modified: August 21, 2016

---

# Importing Data

 *  Resolved [kirkward](https://wordpress.org/support/users/kirkward/)
 * (@kirkward)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/importing-data-3/)
 * Running WP in MultiSite mode. Would like root site to show all locations. Is 
   it possible to link the data from the sites to the root or main blog site into
   some sort of aggregation?
 * [https://wordpress.org/plugins/wp-store-locator/](https://wordpress.org/plugins/wp-store-locator/)

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

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/importing-data-3/#post-4866376)
 * It could be possible, but it would require some modifications. I don’t know how
   your php skills are, but you would first have to get all the ids of all the blogs
   and then query the correct db and merge all the data.
 * Something like this (untested)
 *     ```
       $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
   
       foreach ( $blog_ids as $blog_id ) {
          switch_to_blog( $blog_id );
          //make the query to the correct db and merge them into a big array
       }
       ```
   
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/importing-data-3/#post-4866377)
 * You would do this in the wpsl-ajax-functions.php around line 53 where the normal
   query runs.
 *  Thread Starter [kirkward](https://wordpress.org/support/users/kirkward/)
 * (@kirkward)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/importing-data-3/#post-4866382)
 * Thanks, that helps a lot. I did something similar with the store locator I used
   before, but since I have to struggle with coding I wasn’t looking forward to 
   doing it again. This gives me a good head start.
 * I hope I can find the old code, and maybe it wasn’t in the folder that got deleted.
   Having that and this would make things pretty simple. Then I just create a page
   or button to run it.
 *  Thread Starter [kirkward](https://wordpress.org/support/users/kirkward/)
 * (@kirkward)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/importing-data-3/#post-4866384)
 * Oops, being a slow typist, I missed your second post whilst thinking and writing
   my reply. The second reply helps even more.

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

The topic ‘Importing Data’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

## Tags

 * [aggregate](https://wordpress.org/support/topic-tag/aggregate/)
 * [aggregation](https://wordpress.org/support/topic-tag/aggregation/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)

 * 4 replies
 * 2 participants
 * Last reply from: [kirkward](https://wordpress.org/support/users/kirkward/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/importing-data-3/#post-4866384)
 * Status: resolved