The best way how to create CSV file is to download sample CSV file via button right in plugin screen. This action will generate csv file with structure for all columns available in your theme for Item posts or their taxonomies like Categories or Locations. Always use generated csv file with all columns, do not remove any column from the file. Columns you will not use just left empty.
Once your file is created, you can select it in Import From File section and press Import button. The process will start in a short time and you will see the progress in progress bar.
If you’re going to import several files, we recommend to reload page after the previous import finished
CSV Import/Export plugin is intended to export and import data in one theme, do not use it for migration of data between themes because structure of each theme may be different.
After plugin installation, new menu item appear in your Theme Admin menu:
If you select which type of data you will import the appropriate section will appear. Each column has a specific type of data which are explained in section Types of CSV fields available in this documentation page.
If the import failed for some reason, you will be informed in the red alert box below Import button. If you will open the new ticket in our support forum, please attach this message, CSV file and theme name in your ticket so our team can locate the issue much easier 🙂
Types of CSV fields
Following table shows you example of data expected in type of column – follow please structure of data mentioned in Example column to create your own data for appropriate type of column in csv file. What is the type of column in your csv file you can see right on plugin screen.
|slug||Unique identifier for new item/category/location and must be filled with single lower case word. The slug will appear in URL (domain.com/item/my-slug). Do not use spaces or capital letters||;my-item;|
|text||Rows which contain longer text like Content, Excerpt must contain text between quotes||;”Item’s long content with special characters and multiple lines”;|
|string||Short and plain texts without any formats, multiple lines, html tags||;Item Title;|
|number||Accepts only integer numbers||;999;|
|post-status||Specifies if new Item is set as draft or publish. Available values [‘draft’, ‘publish’]||;publish;|
|author-id||Assign Item to the existing user by ID number. If leave empty Item is assigned to Administrator||;123;|
|date||Date format must be strictly like: “2014-07-28 14:21:31”||;2014-07-28 14:21:31;|
|featured-image||field must contain Attachment Name without the file extension .jpg (how to find file name)||;my-image-name;|
|taxonomy||list of category/location slugs into which you want to assign item. If you assign item to several categories separate them by “|”||;usa|new-york|manhattan;|
|latitude||GPS lat coordinate in floating number format. ONLY valid floating operator is “.”||;48.7287799;|
|longitude||GPS lng coordinate in floating number format. ONLY valid floating operator is “.”||;21.2541327;|
|image||full url path to the image||;http://localhost/ait/develop/directory2/wp-content/uploads/sites/2/greybar.png;|
|on-off||disable or enable option. Available values [“0” – disabled, “1” – enabled, ” “(empty field) – disabled]||;1;|
|url||full website link which must contain also “http://” part||;https://www.youtube.com;|
|color||Hex code of color||;#43a16f;|
|font-awesome||code for font awesome icon||;fa-facebook;|
|select||accepts only pre-defined values. Read more in Special Fields|
Some options may have multiple information inside. For example each of Social Icons (see the image Clone Items) has both Icon and Link inputs. If you want to create 2 Social Icons you have to add 2 values in both columns separated by “|”.
Example for two social icons where you are going to specify both Icon and Link url: “fa-facebook|fa-twitter;http://www.facebook.com/AitThemes|http://twitter.com/AitThemes” – this will create two social icons, first facebook social icon with link to your facebook page, and second twitter social icon with url to your twitter page.
If the section is (clone) the csv column name will consist of 2 parts glued with “@”. First part is a name of whole section (e.g “socialIcons”) and the second part is a specific for each social icon input (e.g “socialIcons@icon” or “socialIcons@link”).
Important rules for CSV File content
- For best formatting we strongly recommend to use this free tool: OpenOffice
- File encoding should be UTF-8
- First row of csv file must be ONLY
"sep=;", nothing else. Plugin works only with semicolon separator – ;
In case you are using Excel to work with CSV files, note that Excel use separator defined in your operating system. How to change separator for Excel
- Second row must contain names of columns. Your own data starts in third row of csv file.
- If you use in your CSV post_name (first field) which already exists in databaes such item post or taxonomy, this record will be updated and not duplicated! Keep that in mind when you will create translations for items. post_name must be always unique across all languages!
- Categories and Locations must be imported or manually created before you import Item Posts. Otherwise items will not be assigned to correct taxonomies.
- If you import a lot of categories at once, they have to be ordered in the file hierarchically, so on the top of csv file must be parent categories and afterwards their child categories with specifiec slug of parent category created in csv file upper.
- Items are imported in small groups for 30 records to eliminate server failures. But we still recommend to keep files as small as possible (around 500 records per file). If you see Unknown server error you probably exceeded the server performance and you have to use smaller files.
You can upload posts and taxonomies for different languages, but association between them cannot be done via CSV file as getting of IDs from wordpress is basically the same work as manual associating of posts via dashboard. WordPress do not allow us create posts or taxonomies with manually defined ID for post or taxonomy, that’s why it’s not possible create data in csv file associated between more languages.