CSV Import Duplicates Handling

Buy the Power Add On
Buy the Power Add On

The Power Add On allows you to import CSV files with several options.   One of those options is “duplicates handling”.   Duplicates handling determines how to deal with locations in your CSV file that may match pre-existing locations on your site.

There are several options available for duplicates handling including Add, Skip, and Update.

Add

This is the most efficient option as all records in the CSV file are added without checking for duplicates.   There are no additional reads performed on the locations table to see if there is pre-existing data.   Reading things from the database is slow.   Selecting add skips the “read the database to see if the thing I’m importing already exists” step so this can be MUCH faster.  Especially if your site has hundreds of locations.

Skip

If a location already exists in the database, skip the new data in the CSV file.  This is useful if you have a CSV file that may contain some new locations that you want to add but you do not want to overwrite any local edits you may have made in your locator on your site for pre-existing locations.

Update

This option will look at the existing locations on your site and update the data if the location already exists.

Does A Location Already Exist

Both update and skip use two methods for determining if a location already exists on your install.

sl_id

The first, and most efficient, method is to include the Store ID column in your import file.   This is a column in the CSV file with a header of ‘sl_id’.

This works great if you are working from a CSV file that was created by EXPORTING your locations first then updating the CSV file and re-importing the locations.

This does NOT work well if you have deleted all the locations after the export or are setting up a new site or migration locations between sites.

The sl_id must match EXACTLY with a location already in the database.   It will be a number. You can hover over the location to see what number is assigned to the sl_id. If you export locations, then delete them all since your location IDs will no longer exist.    Same thing if you move locations between two sites.

You CANNOT make up your own location IDs.  The sl_id is assigned by the WordPress database engine.  You can reference it but cannot modify it.   Think of it as a read-only option that can be used to match things up in your location data.  If you want to assign your id, there is a field in Contact Extender to do that.

f you want to reference and external ID, one you’ve assigned or that comes from a source outside of Store Locator Plus, then you will want to Enable Contact Fields which provides a new data field called “Identifier”.    This IS a location ID field that you can create/modify to be whatever you like to uniquely identify locations.  It is often used to reference an external data source for imports.

If you import a CSV file and the sl_id does NOT exist in your locations table a new location will be added even if you have Duplicates Handling set to “skip” or “update”.

Address Matching

If you do NOT include an sl_id column in your import CSV file and you have selected “skip” or “update” as the duplicates handling method then the system will use a “full address match” algorithm to find a pre-existing location.

The address matching must match PERFECTLY with capitalization, spaces, and the full address of a pre-existing entry.   Therefore this method is only useful if you are NOT updating the primary address information.  Updating the description, store hours, or other information, for example.

The FULL ADDRESS field is comprised of the following location fields:
The Store Name + Address + Address Line 2 + City + State + Zip + Country