Title: Import from PHP code
Last modified: July 25, 2017

---

# Import from PHP code

 *  [RazyRx](https://wordpress.org/support/users/razyrx/)
 * (@razyrx)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/)
 * Hello,
 * Please provide some information.
    How I can import CSV file via PHP code from
   other plugin? Is it possible at all.
 * Regards,
    Oleg

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

 *  [superkot](https://wordpress.org/support/users/superkot/)
 * (@superkot)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9349998)
 * I dont think I understand the question. You want to import CSV file, there are
   plugins that can do it. You need not to care of their code (although it is of
   course php).
 *  Thread Starter [RazyRx](https://wordpress.org/support/users/razyrx/)
 * (@razyrx)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9352896)
 * Hi [@superkot](https://wordpress.org/support/users/superkot/),
 * I need information about function or class of WooCommerce that uses to import
   products to call it from my plugin. Plugin already loads CSV file from server
   and place it in uploads folder, but i want to use WooCommerce importer to import
   products from this file.
 * Regards,
    Oleg
 *  [superkot](https://wordpress.org/support/users/superkot/)
 * (@superkot)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9352931)
 * Woocommerce does not have its own import, as far as I know. You need to process
   your CSV file line by line, creating a “product” WordPress post type per each
   line and populate it with data.
 * This link might help:
    [http://lukasznowicki.info/insert-new-woocommerce-product-programmatically/](http://lukasznowicki.info/insert-new-woocommerce-product-programmatically/)
 *  Thread Starter [RazyRx](https://wordpress.org/support/users/razyrx/)
 * (@razyrx)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9353033)
 * Hi [@superkot](https://wordpress.org/support/users/superkot/),
 * On the WooCommerce site [https://woocommerce.com/products/product-csv-import-suite/](https://woocommerce.com/products/product-csv-import-suite/)
 * NOTE: A new product import/export feature is built into WooCommerce as of the
   3.1 release, launched in June 2017. We aim to phase out this extension over time
   and include its features and functionality directly in WooCommerce. Until then,
   Product CSV Import Suite is here for you with the benefits below.
 * And WooCommerce can Import/Export products from admin panel, but I can’t find
   any documentation about it.
 * Regards,
    Oleg
 *  [superkot](https://wordpress.org/support/users/superkot/)
 * (@superkot)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9353112)
 * Ok, thats new and I’ve missed it.
 *  Thread Starter [RazyRx](https://wordpress.org/support/users/razyrx/)
 * (@razyrx)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9357443)
 * Hi,
 * Unfortunately can’t find any function to import products from file like woocommerce_import(
   $filename);.
 * For now I am uses code from `do_ajax_product_import` function from `WC_Admin_Importers`
   class and this work normal, but doesn’t work at all from multisite for specific
   blog.
 * Regards,
    Oleg

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

The topic ‘Import from PHP code’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [RazyRx](https://wordpress.org/support/users/razyrx/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/import-from-php-code/#post-9357443)
 * Status: not resolved