WordPress / WooCommerceFebruary 2017

Datafeedr API Customisation

Resolved category reset issue in Datafeedr’s WooCommerce API integration by creating a custom hook and metadata recovery process to preserve manually defined product taxonomies.

Technologies Used

WordPressWooCommercePHPMySQLDatafeedr APIPlugin Hooks
Datafeedr API Customisation

Project Gallery

Datafeedr API Customisation screenshot 1

Project Metrics

Architecture

Custom WordPress hook and metadata solution

Functionality

Preserved manual product categories during API updates

Stability

Zero product data loss during synchronization

Compatibility

Seamless integration with Datafeedr’s native update process

Maintenance

Code-safe and upgrade-compatible solution

Challenges

  • Datafeedr API overwriting manually defined WooCommerce product categories during synchronization
  • Default category reset with each product update
  • Maintaining compatibility with Datafeedr’s core plugin logic
  • Ensuring categories persisted without corrupting API data flow

Solutions

  • Reverse-engineered Datafeedr’s update process to identify taxonomy hooks
  • Created a pre-update function to store product category term IDs in custom metadata
  • Hooked into the update cycle to restore existing categories post-sync
  • Used selective unsetting of default taxonomy arrays during product updates
  • Implemented lightweight PHP logic for future plugin compatibility

Results

  • Manual WooCommerce product categories now retained after every Datafeedr sync
  • No interruption to Datafeedr’s automatic updates
  • Improved store management efficiency for fashionandbusiness.nl
  • Reinforced Datafeedr’s reliability without modifying its core files

Project Overview

Datafeedr is a WordPress plugin that enables store owners to build affiliate or product-feed stores that automatically update from multiple merchant networks.
While powerful, its update mechanism overwrote manually defined WooCommerce product categories each time it refreshed the feed — a critical problem for FashionandBusiness.nl, who curated categories post-import for better organization and SEO.

The goal was to retain manual taxonomy assignments through Datafeedr’s automated sync process, without altering the plugin’s core structure or future update compatibility.


Technical Challenge

Each API sync re-imported selected products from Datafeedr’s product sets, automatically resetting taxonomy term IDs (product categories) back to defaults.
Since the client manually assigned categories after import, every update cycle undid hours of work.

The challenge was to preserve these manually set taxonomies while allowing the Datafeedr API to continue updating product content and pricing.


Solution Architecture

Phase 1: Investigation

By inspecting Datafeedr’s source and update logic, I located the hook responsible for triggering product updates, which also cleared existing taxonomy relationships.

Phase 2: Metadata Preservation

Before each update:

  • A custom PHP function captured the current taxonomy term IDs (product categories) for each product.
  • These IDs were stored in custom metadata attached to that product’s post record.

Phase 3: Controlled Update Injection

During the update cycle:

  • The plugin’s default taxonomy term array was unhooked.
  • The preserved term IDs were merged back into the update payload, ensuring categories remained intact.
  • The product post was updated with new API data, without losing its assigned categories.

Phase 4: Validation

After applying the solution:

  • All products retained their manually curated categories.
  • Datafeedr’s scheduled and manual syncs continued to function normally.
  • Database integrity and plugin update compatibility were fully maintained.

Technical Highlights

  • Custom WordPress Hook Integration: Non-intrusive and future-proof
  • Metadata Backup Layer: Category term preservation without external tables
  • Selective Array Unset Logic: Prevented default taxonomy reset
  • Backward Compatibility: Fully aligned with WordPress 4.7+ core API standards

Outcome

“Anton resolved a long-standing Datafeedr issue that most developers overlooked. Our manual product categories now persist perfectly after every update.”
Chris, FashionandBusiness.nl

Key Results

  • Categories persist after Datafeedr product updates
  • Streamlined workflow and reduced manual reclassification
  • Non-destructive solution, plugin update-safe
  • Fully compatible with future Datafeedr versions

Legacy Context

This project illustrates Anton’s early focus on plugin extensibility and non-invasive architecture, solving real-world business problems by adapting to existing ecosystems rather than overriding them — a principle that defines Villiers Vision Works’ current engineering approach to modular, API-first development.

Ready to Build Something Amazing?

Let's discuss how we can transform your ideas into powerful software solutions.