Import Listings

NOTE: Before you import ANY records, you should completely setup and configure ALL form fields you plan to use in your directory. This will save you any headaches from data you missed during mapping.

NOTE: Be sure to use the “See Sample CSV File” button at the top to get started with a template CSV file.

CSV Imports are supported in Business Directory 2.1 and higher.

To import listings via CSV, you must do the following:

  • Provide a CSV file that is of the correct format. After you configure your form fields, there is a sample CSV file that Busines Directory will create for you as a starting template. We highly recommend that you use this as the starting point to avoid column naming errors!

  • If you want to import images within your ads as well, you must provide a separate ZIP file with all the images contained in it. The names of these images should be referenced in the “images” column of your CSV file. If you have multiple images for a single ad, you must separate them with the “Image Separator” character. (Semi-colon by default (;)). For example: image1.png;image2.gif;image3.jpg. Set the path to this file in the ZIP containing images file textbox.

    NOTE: The image file is often the reason for a failed import. Try to use the smallest size of image you think you will need, at most. Putting 100 2MB images into a ZIP file will only choke the uploader and cause timeouts during upload!

  • Decide how to handle categories for import. BD can do it two ways: Auto Create Categories or Generate error if Category not found. The Auto Create option is good for new installations where you have an existing set of categories you want to use. The Generate error option is good if you already manually setup your categories and want to make sure the import conforms to your existing structure. NOTE: BD can only handle single-level category creation on import (top level categories only). So if you want something more complex with children, you might want pre-define your categories and use the second option.

  • Imported ads can be assigned to a user by using the user_id column in the CSV file. The user_id must match a login name of an existing user in your WordPress site. If you want ads assigned to a particular user on import, you should check this box. Otherwise, leave it unchecked.

  • If you checked Assign to User, and an ad does not have a user_id defined in the CSV, you can assign it to a default user, such as admin. Select the user you wish to user as the default one. Only valid if you checked Assign to User in the step above.

  • Once you configure these options, you can try out your import and see if any errors will be generated by clicking “Test Import”. If all goes well on the test, you can perform the actual import by clicking “Import”, which will load the BD tables with the data you configured above.

HELPFUL HINTS with CSV Imports and Common Errors to Avoid

  • Your CSV file should be based on the sample CSV file that is created under Directory Admin->CSV Import. Generate that if you haven’t already.
  • Your CSV file must have every column from the sample file, named exactly the same. Don’t delete any of them
  • Your CSV file should have data in every column that is required. Optional columns/fields can be left blank, but should not be deleted
  • Text fields can’t have single quotes in them without putting double quotes around the whole field (e.g. “Bob’s Market”)
  • Dates must be in the expected format of the CSV import settings
  • Imports work best after you’ve completed all field configuration, so make sure you do that first (especially naming)

CSV Import Options

Here are the options you can configure for importing data.

Import Files

  • CSV File (required): Path to the CSV file you will use for import. We recommend keeping the overall import size under 5MB to avoid timeouts
  • ZIP file containing images: Path to the ZIP file that contains the referenced images in the CSV (optional, unless you used images, in which case it’s required)

CSV File Settings

  • Column Separator (required): What separator should be searched for between columns? Default is comma (,). Do not duplicate this separator in the other separator values!
  • Image Separator (required): What separator should be searched for to separate multiple images in the image column? Default is semi-colon (;). Do not duplicate this separator with the column separator!
  • Category Separator (required): What separator should be searched for to separate multiple categories in the category column? Default is semi-colon (;). Do not duplicate this separator with the column separator!

Import settings

  • Missing categories handling (required): Should BD be allowed to auto-create categories or instead, generate errors when a category is not found
  • Assign listings to a user?: If the user column does not contain a value for a listing, what user should be assigned instead? Default is admin
  • Default listing user: This user will be assigned to all listings if the username column is not present in the CSV file at all.

At the bottom, you can either click on “Test Import” or “Import”. We strongly recommend trying a Test Import before running a full import to see if you will encounter problems with your file(s) or settings first!

NOTE: Be sure to use the “See Sample CSV File” button at the top to get started with a template CSV file.

The bottom of the page also contains a helpful full grid showing you all fields in your configuration, whether they are required and/or multi-valued (like select lists, checkboxes and radio buttons) to help you understand any errors you may encounter.

FAQs

Is it possible to update listings en masse using a CSV file?

Listings can be exported with an unique ID, so that the data can be imported later without creating a copy of the listing, updating the old one instead. To do that, use the Include unique IDs for each listing setting in the CSV Export admin screen.