The Import and Export area allows you to manage your listing data in bulk. You can mass-create listings with CSV imports, and you can mass-edit listings by doing a CSV export, editing the CSV file, and then re-importing the CSV file with the changes.
Depending on which operation you need to perform, you select the appropriate link.
In order to import the information into AWPCP, your CSV file will need to be in a format that AWPCP can read. The column headers are the field names that are set up in your version of the plugin.
To begin your import, go to Classified Admin > Import & Export > Import and click this button:
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
Images source: Path to the ZIP file that contains the referenced images in the CSV (optional, unless you used images, in which case it’s required)
You will find the exact headings you need under Classified Admin > Import & Export when you click on Import Listings:
FILE SIZE NOTE: There is no upper limit on the number of records that can be imported using the CSV file process, though your hosting plan may have some effect on the process. This is typically something that your hosting company can help you with, including reading any error logs that have been produced.
How to Import Your Data
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 AWPCP 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!
CSV Import Options
Here are the options you can configure for importing data.
CSV Configuration Settings
There are default values selected for each of these options, which you should review and adjust to match the requirements of your CSV file. The default values are the recommended values to use.
Define default values for the start date and end date columns? (optional): Add a start or end date to your imported ads.
Date format (required): Choose the appropriate date format for your use.
Separators used in CSV (required): These separators are pre-filled for your convenience. You should change them only if you have used different separators in your CSV file.
- Date Separator (required): What separator should be searched for between dates? Default is forward slash (/). Do not re-use this separator value in the other separator values! It will make your file unreadable to the AWPCP importer.
- Time Separator (required): What separator should be searched for to separate times in the time column? Default is colon (:).
- 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! It will make your file unreadable to the AWPCP importer.
How to handle missing categories (required): Decide how to handle categories for import. AWPCP 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: AWPCP 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.
Here is an example of how to format categories for import:
Assign listings to a user (required): 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.
Define a default user (required): 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”. 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!
If all goes well on the test, you can perform the actual import by clicking “Import”, which will load the AWPCP tables with the data you configured above.
Troubleshooting your Import
Follow the tips below to be sure that you have the correct information in your CSV file:
Common Errors to Avoid During Import
- Your CSV file should be based on the sample CSV file that is created under Classified Admin > Import & Export when you click on Import Listings. Generate that if you haven’t already.
- Your CSV file must have every column from the sample file, named exactly the same as shown in your grid on this configuration page. Don’t delete any of them, especially the OPTIONAL ones.
- Your CSV file should have data in every column that is required. Optional columns/fields can be left empty below the header, but you cannot remove the column!
- 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)
Please note that the export process is a resource-intensive task. If your export does not succeed try disabling other plugins first and/or increasing the values of the 'memory_limit' and 'max_execution_time' directives in your server's php.ini configuration file.
To export ads via CSV, you must have data in your classifieds site, either through direct entry OR via CSV Import.
CSV Export Options
Here are the options you can configure for exporting data.
Which listings to export?: How to filter the exported listings: All, Active only, or Active + Pending Renewal.
Export images?: Checkbox indicating whether you want to output the images with listings or not. If you’re only doing bulk data edit, don’t check this option as it speeds up the export. You'll want to make sure that on re-import you have the option "Keep existing images" CHECKED to not accidentally remove your images during reload.
Additional metadata to export: Checkboxes for optional columns to include in the export. If you are doing bulk data edit and plan to re-import the data, be sure to check the option “Include unique IDs for each listing (sequence_id column).” Other data available includes the author information (username). This can be edited and re-imported if desired.
CSV File Settings
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!