phpwordpresswoocommerceimportsku

WooCommerce product not searchable by SKU when created by import


When importing products with CSV searching for one of the products created by the import by name works, but searching for the SKU returns nothing. This is true both in admin and the storefront (using a search plugin that can search by SKU).

The created products are also visible at the top of the product list, and it lists the SKU correctly.

If a product is updated (going into edit or quick edit and just clicking update) it is then searchable by SKU both in admin and the store.

If a product is created manually and then updated with import this is not an issue.


Solution

  • I had the same problem, and symptoms after WooCommerce's built-in CSV import (wouldn't be found in search until I manually published or updated). It also affected Point of Sale for WooCommerce (could not search SKU to generate barcodes).

    I found the solution was to rebuild the WooCommerce index, I went to WooCommerce Settings -> Search -> Index -> Rebuild, then Run the indexer. I believe the indexer is refreshed on each publish, and for some reason isn't refreshed on CSV import.

    My admin searches and Point of Sale searches worked after that. This was on WooCommerce 4.0.1.

    I also found searches had to have at least three SKU characters in the search field to return results.