WP Manifestindependent plugin directory
manifest / ecommerce / kleinanzeigen-woo-import

Kleinanzeigen WooCommerce Import

WordPress plugin that imports kleinanzeigen.de store listings into WooCommerce as draft products, via a Tools → Import admin page or a WP-CLI command.

by Serge · github.com/serge22/kleinanzeigen-woo-import

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/serge22/kleinanzeigen-woo-import/archive/refs/heads/main.zip

Readme

Kleinanzeigen WooCommerce Import

Imports listings from a kleinanzeigen.de store into WooCommerce as products, either through a Tools → Import page in wp-admin or via WP-CLI.

Requirements

  • WordPress with WooCommerce active (Requires Plugins: woocommerce)

How it works

The plugin talks to kleinanzeigen.de's public ads API (api.kleinanzeigen.de) to:

  1. List the ads belonging to a given store ID.
  2. Fetch full details (title, description, price, images) for a single ad.

Each imported ad becomes a draft WC_Product_Simple with:

  • Name and description from the ad
  • Regular price, if the ad has one
  • SKU set to ka-<ad id>
  • Post meta _kleinanzeigen_ad_id and _kleinanzeigen_url recording the source ad
  • Images sideloaded from the ad into the product's image and gallery

An ad is only ever imported once: before creating a product, the importer looks for an existing product with matching _kleinanzeigen_ad_id meta and reuses it instead of duplicating.

Importing from wp-admin

Go to Tools → Import → Kleinanzeigen (or use the "Import" plugin action link).

  1. Enter a store ID and click Preview products to fetch and list its ads. The preview is cached to disk (system temp dir) so reloading the page doesn't re-hit the API.
  2. Select the products you want (or "select all") and click Import selected products.
  3. Each selected ad is imported one at a time via AJAX, with a progress bar and a per-item log (created / already imported / failed, linking to the edited product).

Importing via WP-CLI

wp kleinanzeigen import [--store-id=<store-id>] [--size=<size>]
  • --store-id — kleinanzeigen.de store ID to import ads from. Defaults to the same store as the admin UI (125588).
  • --size — page size used when requesting ads from the API. Defaults to 50.

This fetches every ad for the store (following pagination) and imports all of them in one run, showing a progress bar and a final summary of created / already-imported / failed counts. Like the admin importer, already-imported ads are skipped.

Example:

wp kleinanzeigen import --store-id=125588

File overview

  • kleinanzeigen-woo-import.php — plugin bootstrap; registers the importer page, AJAX handler, and WP-CLI command.
  • includes/class-api-client.php — HTTP client for kleinanzeigen.de's ads API (list + detail lookups).
  • includes/class-product-importer.php — creates/reuses a WooCommerce product from a single ad.
  • includes/class-cli-command.phpwp kleinanzeigen import command.
  • includes/class-cache.php — on-disk cache of the last previewed ad list per store ID.
  • templates/import-page.php — admin import page markup.
  • assets/import-page.js — drives the admin import page's selection, AJAX import loop, and progress UI.

Notes

  • The API credentials in class-api-client.php are for kleinanzeigen.de's public/anonymous API access, not per-user credentials.
  • Imported products are created as draft, so review pricing, description, and images before publishing.

Read the full README on GitHub →