Projects Stopped an automated product feed from overwriting hand-picked categories
Stopped an automated product feed from overwriting hand-picked categories
An automated Datafeedr product import kept resetting the store’s manually organised categories. I fixed it so manual work stuck.

- How long
- 2017
- My role
- DevelopmentSupport
- Kind of project
- IntegrationSmall project
What the business needed.
fashionandbusiness.nl used the Datafeedr plugin to automatically pull in and update a collection of products into their WooCommerce store. The problem: every time the automated update ran, it reset the products’ categories back to Datafeedr’s own defaults, wiping out the categories the client had carefully set by hand after each product was added.
What I did.
My first attempt, stopping the default category IDs from being passed during the update, caused some products to stop updating correctly. I went back into the plugin’s own code, found the hook that fires right before it overwrites categories, and used it to save the current, manually set categories to the product before the update ran. Then, inside the update itself, I removed Datafeedr’s default categories and put the saved ones into the data being written, so the product still updated normally, but the manual category work survived.
What they got.
An automated feed that kept their catalogue current without quietly undoing their manual organisation every time it ran.
For your technical person
Stack: WordPress, PHP, MySQL, Datafeedr API. Root cause: Datafeedr’s update process reset WooCommerce product category terms to its own default taxonomy terms on every sync, overwriting manually assigned categories. First approach (unsetting default taxonomy term IDs during update) caused inconsistent update failures on some products. Final approach: hooked into the plugin’s update method, stored the product’s current term IDs in custom post metadata before the update cleared them; then, during the update, unset the default taxonomy terms and added the saved term IDs to the array passed into the update, leaving the rest of the automated update intact. Client: Chris, fashionandbusiness.nl. Project size: small. Delivered 2017.
Related work.
The service behind this project
Get your systems talkingWordPress and WooCommerce serviceAll projectsRunning into the same problem? Tell me about yours.
+27 87 150 9305Monday to Friday, 09:00 to 20:00 SAST. Or email info@antondevilliers.com.