Plugin / Advanced CSV Importer

Takayuki Miyauchi

Description

Description

The Advanced CSV Importer will import the following content from a CSV file.

Advanced CSV Importer is fully unit-tested. The plugin is stable and ready to be used in large projects like enterprise applications.

  • Posts, pages and other custom post types
  • Custom fields and post meta
  • Categories, tags

https://github.com/miya0001/advanced-csv-importer

This plugin requires PHP 5.3 or later.

Default CSV field names

  • ID
  • post_content
  • post_name
  • post_title
  • post_status
  • post_type
  • post_author
  • ping_status
  • post_parent
  • menu_order
  • to_ping
  • pinged
  • post_password
  • guid
  • post_content_filtered
  • post_excerpt
  • post_date
  • post_date_gmt
  • comment_status
  • post_category
  • tags_input
  • page_template

You can change field name via acsv_post_object_keys hook like following.

add_filter( 'acsv_post_object_keys', function( $post_object_keys ){
    $post_object_keys['title'] = 'post_title';
    $post_object_keys['content'] = 'post_content';
    return $post_object_keys;
} );

Other columns will be saved to the custom field.

There is a sample of the CSV.

Action Hooks

  • acsv_after_insert_post

Filter Hooks

  • acsv_post_object_keys
  • acsv_post_defaults
  • acsv_import_upload_size_limit
  • acsv_pre_get_post_objects
  • acsv_after_get_post_objects
  • acsv_csv_format
  • acsv_csv_to_hash_array
  • acsv_get_user_by_field

WP-CLI

Importing:

$ wp csv import tests/_data/wp/sample.csv
+------+-----------------------+------+---------+------------+---------------------+
| ID   | Title                 | Type | Status  | Author     | Date                |
+------+-----------------------+------+---------+------------+---------------------+
| 1720 | CSV Import Test       | post | publish | admin      | 2013-09-13 00:00:00 |
| 1721 | define author test    | post | publish | admin      | 2014-12-27 18:44:46 |
| 1722 | define author id test | post | publish | themedemos | 2014-12-27 18:44:46 |
| 1    | Hello world! Updated! | post | publish | admin      | 2014-12-27 18:44:46 |
+------+-----------------------+------+---------+------------+---------------------+

History:

$ wp csv log
+----------+-----------------------------+---------------------+---------+---------+
| ID       | Title                       | Date                | Success | Failure |
+----------+-----------------------------+---------------------+---------+---------+
| e0a66344 | Imported from WP-CLI.       | 2014-12-27 18:44:46 |       4 |       0 |
| 43c47af6 | Imported from admin screen. | 2014-12-27 16:53:17 |       4 |       0 |
| df0f140b | Imported from WP-CLI.       | 2014-12-27 16:21:42 |       4 |       0 |
+----------+-----------------------------+---------------------+---------+---------+

Details of the history:

$ wp csv log e0a66344
+------+-----------------------+------+---------+------------+---------------------+
| ID   | Title                 | Type | Status  | Author     | Date                |
+------+-----------------------+------+---------+------------+---------------------+
| 1720 | CSV Import Test       | post | publish | admin      | 2013-09-13 00:00:00 |
| 1721 | define author test    | post | publish | admin      | 2014-12-27 18:44:46 |
| 1722 | define author id test | post | publish | themedemos | 2014-12-27 18:44:46 |
| 1    | Hello world! Updated! | post | publish | admin      | 2014-12-27 18:44:46 |
+------+-----------------------+------+---------+------------+---------------------+

Ratings

4
1 reviews

Rating breakdown

Details Information

Version

0.1.6

First Released

28 Dec, 2014

Total Downloads

4,976

Wordpress Version

4.0 or higher

Tested up to:

4.2.25

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.