WP CSV to Database plugin allows you to insert CSV file content into WordPress database. Useful when you want to bulk upload data from your CSV file (e.g. product details) to the WordPress database (MySQL) in one go.
If you didn’t know what aÂ CSV file is then you can learn more from Wikipedia. You can use Microsoft Excel to enter all your data and then save the file as a CSV file.
Many of my WordPress Shopping Cart users have requested me to add an option so that they can bulk upload their product details into the database from a CSV file (really useful when you have hundreds of products). Hopefully this plugin will satisfy that need and in addition you will be able to use it to bulk upload any data into your WordPress database to save you time.
Installation of the Plugin
- Go to the Add New plugins screen in your WordPress admin area
- Click the upload tab
- Browse for the plugin file (wp-csv-to-db.zip)
- Click Install Now and then activate the plugin
Usage of the Plugin
Step 1 (Select Database Table):
- All WP database tables will be queried and listed in the dropdown box.
- Select the table name which will be used for the query.
- Once the table is selected; the “Table Preview” will display the structure of the table.
- By structure, this means all column names will be listed in the order they appear in the database.
- This can be used to match the .csv file prior to execution; and verify it contains the same structure of columns.
Step 2 (Select Input File):
- The option will be used to locate the file to be used for execution.
- A direct url to a .csv file may be entered into the text field.
- Alternatively, the “Upload” button may be used to initiate the WordPress uploader and manager.
- From here, the file can be uploaded from a computer or selected from the media library.
- The “Number of .csv file Columns” will populate when the Input File field contains a valid .csv file.
Step 3 (Select Starting Row):
- The .csv file will contain rows, which get converted to database table entries.
- This option will allow customization of the starting row of the .csv file to be used during the importation.
- Row 1 is always the top row of the .csv file.
- For example: If the .csv file contains column headers (column names), it would most likely be desirable to start with row 2 of the .csv file; preventing importation of the column names row.
Step 4 (Disable “auto_increment” Column):
- This option will only become available when a database table is selected which contains an auto-incremented column.
- If importing a file which already has an auto-incremented column… this setting most likely will not be needed.
Step 5 (Update Database Rows):
- By default, the plugin will add each .csv row as a new entry in the database.
- If the database uses a primary key (auto-increment) column, it will assign each new row with a new primary key value.
- This is typically how entries are added to a database.
- However; if a duplicate primary key is encountered, the import will stop at that exact point (and fail).
- If this option is checked, the import process will “update” this row rather than adding a new row.
Download Latest Version
Download the CSV to DB plugin.
How to Use This Plugin to Bulk Upload WP eStore Products
If the cell values in the CSV file have special characters like apostrophe (‘) or quotes (“) then don’t forget to use a backslash before them (e.g Karen\’s book). You shouldn’t need to do this anymore if you are using v1.5 or above.
The video tutorial on the following page might also be a good resource for importing data into your WordPress database table:
If you have any issues with the plugin please leave a comment below.
Check out ourÂ WordPress plugins pageÂ for more cool WordPress plugins.