How to import from CSV to our WordPress plugins correctly
All of our plugins can import or export plugin data to or from CSV files using a import/export/export module. If you're using a starter plugin or the plugin you purchased does not include this module, you can always purchase it as a separate plugin. If your plugin comes with the Import/Export/Update module, you should see "Operations" button in app list screen next to the "Add New" button in the admin area when logged in as admin.
The Import/Export/Update module uses the metadata included in the plugin code to work. The module ensures your plugin works as expected by;
- Checking data rules(unique,required, default fields).
- Checking app design rules(taxonomies, relationships and associated fields).
The enforcement of the data and app rules ensures that your data is properly represented and can be modified when needed. You can also use the module to backup, restore or reset your data.
Please do not use the third party CSV importers since they lack the logic to properly import, export or update your data.
How to bulk import your data
The easiest way to start the bulk importing of your data is to manually create a couple of records and export them to a CSV file. You can then fill out the rest of the records correctly based on the ones in the CSV file. Follow the process below to properly export and import your data:
- Export your records to a CSV file. Simply click on the Operations button > Export tab > Export button.
- Import the CSV file to a spreadsheet app. We recommend using Google Sheets; freely available for Google account holders.
- Follow the guidelines below when adding and modifying your data:
- Make sure that all the unique and required fields are not empty. The unique fields must be unique for each row of your data and are required. The unique fields are color coded as red. If there is more than one field marked as unique, you need to make sure that the combination of these fields uniquely identifies a row. For example, if the first name and last name of a contact is marked as unique, you must make sure that there is no other record in your data with the same first and last name. There can be contacts having the same first name or last name but not the same first and last name. The required fields that are not unique fields are color coded as blue and must have a value. If a required field is empty, the whole record is ignored to protect data integrity.
- If your plugin has date fields, these fields must be formated as shown in the export file. We detect and convert most date formats but it is recommended to have the proper format at the first place.
- If your plugin has auto-increment field, make sure it's incremented in the required way.
- Custom fields can be imported as other fields. Add additional columns to your file to accommodate the custom fields if needed.
- Import your records from the CSV file, simply click on the Operations button > Import tab > Import button. You will see the field mapping screen. This is the screen you create the field mappings from the CSV file to your plugin. If you need to update your data, check "Update existing data based on unique field(s)." field. If you do not need to import a field, select "Do not map this field" option. When this option is selected, the field is ignored.
- After the import, check the stats to make sure they make sense; the numbers matches the CSV file and valid records. If your data is not formated correctly based on the plugin requirements or if the records already exist in WordPress and the update option NOT selected, you will see that these records ignored during the import.
- Follow the same process to export and import any plugin relationships.
- Reset your data using the Reset tab, fix the issues and start over if the data was not imported correctly.
Our plugins come with a glossary page accessible in your plugin settings. You can check this page to get more information on certain fields. The glossary file provides the metadata about the data fields included in your plugin.