Tag: bulk edit

  • Why I Built a Bulk COGS Editor for WooCommerce: From Problem Discovery to Development

    Why I Built a Bulk COGS Editor for WooCommerce: From Problem Discovery to Development

    Every WooCommerce store has its own way of managing product costs. But when a store has hundreds or thousands of products, keeping those costs up to date one product at a time quickly becomes a repetitive and time-consuming task.

    This article is the story behind Bulk COGS Editor for WooCommerce—from noticing a real merchant problem, researching existing solutions, and planning the first version to working through performance challenges and improving the user experience.

    Where the problem started

    WooCommerce introduced its native Cost of Goods Sold (COGS) feature to help merchants record product costs and understand profitability. It made product-level cost tracking available in WooCommerce core, but a practical question remained for stores with large catalogs: how do you update the costs of many products when supplier prices change?

    For example, imagine a store with thousands of products. A supplier increases the cost of one brand by 20%, or a store needs to adjust costs across a category. Opening products individually—or relying on a quick-edit workflow—does not scale well for this kind of recurring work.

    A merchant had already described this exact pain point

    During the research, I found a WooCommerce feature request titled “Allow Bulk Editing of COGs”, submitted on November 13, 2025.

    The request explained that stores with thousands of products could not keep up with frequently changing costs through the quick-edit menu. It gave a practical example: increasing the costs for an entire brand by 20% using a bulk-editing tool.

    That example captured the problem clearly. Merchants did not simply need another place to enter a product cost. They needed a reliable way to select the right products and apply a controlled cost update to many of them at once.

    Source: WooCommerce feature request – Allow Bulk Editing of COGs.

    Forum – Real-World Merchant Requests: The Need for Bulk COGS Updates

    This wasn’t just a theoretical problem. WooCommerce store owners had already raised this concern in the WordPress.org support forums. In one discussion, a user specifically asked how to bulk update the Cost of Goods Sold (COGS) pricing across multiple products instead of editing each product individually. This discussion reinforced the need for a simpler and more efficient bulk-editing workflow.

    Read the discussion: Bulk update the new cost (COGS) pricing – WordPress.org Support.

    Researching the existing WooCommerce workflow

    I looked at the native COGS workflow and the ways merchants could already move cost data into WooCommerce. WooCommerce documentation explains how to set costs for individual products and variations, and its product CSV importer/exporter supports the COGS field. Those capabilities are useful, but they do not automatically provide a guided bulk-editing workflow with product filtering, calculated adjustments, a review step, and a controlled background update.

    I also reviewed the wider discussion around product-catalog management. In the WooCommerce developer discussion about COGS, a merchant asked how large datasets should be handled and noted limitations in the built-in import/export workflow for large datasets. Separately, WooCommerce’s product-catalog management epic describes broader merchant pain points such as slow product-editing workflows and inefficient bulk operations in large catalogs.

    These discussions were useful signals that the problem was not just an isolated development idea. Merchants needed more efficient ways to manage product data as their catalogs grew. I treated the COGS request as the clearest, directly relevant use case and the broader catalog discussions as supporting context—not as proof that every store had the same requirements.

    Defining the problem and the first solution

    I wanted to keep the plugin focused: work with WooCommerce’s native COGS data rather than introduce a separate cost system, and make bulk changes understandable before anything was saved.

    The initial product plan centered on a straightforward workflow:

    1. Find products: narrow the catalog using relevant filters.
    2. Choose an action: set an exact cost, or increase/decrease costs by a fixed amount or percentage.
    3. Preview the result: inspect the affected products and proposed values before applying changes.
    4. Process the update: run the work in background batches and show progress rather than trying to update a large catalog in one request.

    This gave the project a clear purpose: make common COGS updates faster to prepare, easier to review, and safer to execute.

    The first performance challenge

    The first implementation exposed an important engineering challenge. In one of my early tests, updating COGS for approximately 13,700 products took around 64 minutes. The value being changed was a product meta value, but the total operation still involved finding the right products, processing them safely, and saving the changes at scale.

    That result changed the priority of the project. A bulk editor is not useful if it only moves the repetitive work into a long-running request or leaves the merchant unsure whether processing is still happening.

    Moving the work into background processing

    I focused the architecture on bounded background work using WooCommerce Action Scheduler. Instead of attempting to process an entire catalog in one request, the operation could be split into smaller batches. The design also needed to preserve progress between requests, isolate failures, and let the merchant understand or cancel an operation.

    • Process products in batches instead of one very large request.
    • Pass product IDs through the processing workflow rather than carrying large product-object collections between steps.
    • Track operation progress and refresh its status while background work continues.
    • Support cancellation and handle failed or interrupted work without treating the entire operation as a single all-or-nothing request.
    • Keep the preview as a review of proposed changes, while the server-side operation remains responsible for the actual update.

    I also moved testing beyond small demo catalogs. A local WordPress environment backed by MySQL/MariaDB made it possible to generate larger product datasets and compare runs at increasing scale. The aim was to test realistic workloads and identify bottlenecks, not to publish a speed claim without repeatable measurements.

    Important: the 13,700-product result above is an early benchmark, not a claim about the current version’s processing time. I am keeping the original measurement visible because it explains why performance and reliability became major parts of the development work.

    Documenting the Performance Benchmark

    I documented this initial performance test and the findings in a GitHub discussion to track the challenges and improvements throughout development.

    The benchmark helped identify performance bottlenecks and highlighted why optimizing database operations, product retrieval, batch processing, and background execution needed to be a priority.

    You can follow the technical discussion and benchmark details here:

    Bulk COGS Editor – Performance Benchmark and Optimization (GitHub Discussion #12)

    This became an important reference point as I continued improving the plugin’s processing efficiency and reliability.

    Improving the interface and workflow

    Performance was only one part of the problem. A bulk operation can affect hundreds or thousands of products, so the interface needs to make each decision clear. I revisited the workflow to make it easier to understand from top to bottom, with a clear sequence instead of presenting too many decisions at once.

    The workflow was organized around four stages: Filters → Action → Preview → Apply.

    • Filters: identify products by criteria such as title, SKU, category, brand, product type, stock status, price, or current COGS.
    • Action: choose the cost operation and enter the value.
    • Preview: review current and proposed COGS values, select the products to include, and understand the changes before committing.
    • Apply: confirm the operation and follow its background progress.

    I also worked on making the navigation and controls more consistent, keeping the steps visible, improving the review table, and making progress, cancellation, and operation status easier to find. The goal was not to add visual complexity; it was to help store owners feel confident before changing product costs in bulk.

    See the Bulk Editing Workflow in Action

    After implementing the core workflow and refining the interface, I documented how store owners can use the plugin to manage WooCommerce product costs in bulk.

    The walkthrough covers the actual working interface, product selection, available COGS update methods, previewing changes, and processing bulk updates.

    If you want to see how the plugin works in practice, read the detailed walkthrough:

    How to Bulk Edit WooCommerce COGS (Cost of Goods Sold) Safely

    Expanding the workflow: CSV, history, and rollback

    As the project evolved, the workflow grew beyond manual bulk adjustments. Store owners often maintain supplier costs in spreadsheets, so importing and exporting cost data became a natural extension.

    • CSV and XLSX import: prepare cost updates from spreadsheet files, validate the input, and review the proposed changes before applying them.
    • CSV export: export product cost data for external review or spreadsheet workflows.
    • Operation history: review previous bulk operations and the product changes recorded for each operation.
    • Rollback: review eligible changes and restore previously recorded costs, with safeguards for products that may have been edited again after the original operation.

    These additions made the plugin more than a bulk-update form. They helped create a workflow around preparing, reviewing, applying, auditing, and—where eligible—reversing cost changes.

    Making it available to WooCommerce store owners

    After iterating on the functionality, performance, and interface, I published Bulk COGS Editor for WooCommerce on WordPress.org. The plugin works with WooCommerce’s native Cost of Goods Sold feature and is intended to help store owners manage product costs without changing product selling prices.

    You can explore the source code on GitHub, try the plugin from the WordPress.org plugin directory, and share feedback or report issues through the project repository.

    What I learned from building it

    This project started with a focused merchant pain point, but solving it properly required more than adding a bulk update button. It involved understanding the existing WooCommerce workflow, designing a safe review process, handling large catalogs in the background, testing real workloads, and refining the interface as the feature set grew.

    The biggest lesson was that performance, reliability, and usability need to be designed together. A fast operation that is difficult to understand is not a good merchant experience; a polished interface that cannot handle a large catalog is not enough either.

    Bulk COGS Editor is an ongoing project. I plan to keep improving it based on real-world usage, feedback from WooCommerce store owners, and further performance testing.

    Have a WooCommerce store with a large product catalog? Give the plugin a try and let me know what would make bulk cost management easier for your workflow.

    Get Bulk COGS Editor for WooCommerce

  • How to Bulk Edit WooCommerce COGS (Cost of Goods Sold) Safely

    How to Bulk Edit WooCommerce COGS (Cost of Goods Sold) Safely

    Need to bulk edit WooCommerce COGS (Cost of Goods Sold) after a supplier price change? Bulk COGS Editor for WooCommerce helps you filter products and variations, save reusable presets, import costs from CSV or Excel (.xlsx), preview every adjustment, and run cost updates in background batches—without changing selling prices.

    Updated for plugin version 1.3.1 (November 2026): Follow the redesigned three-step bulk editor, new account-based filter presets, advanced COGS filters, per-product cost overrides, optional rollback history, and COGS health notices. The tutorial below shows the current interface.

    Before starting, enable native WooCommerce Cost of Goods Sold. For the setting and product-cost behavior, see the official WooCommerce Cost of Goods Sold documentation. The plugin requires WooCommerce 10.3 or later with native COGS enabled.

    The video walkthrough introduces the workflow. Note: it may show an earlier plugin interface; use the updated screenshots and instructions below for version 1.3.1.

    ⚡ Performance Benchmark: 10,000 Products in 15m 24s

    Managing an enterprise catalog? Bulk COGS Editor processes updates through Action Scheduler background batches. In a previously reported WP-CLI benchmark, 10,000 product costs were updated in 15m 24s with zero skipped and zero failed. This is an earlier measured run, not a new 1.3.1 benchmark or a guaranteed processing time.


    Read the full benchmark report & architecture breakdown →

    Jump to: Bulk edit costs · Export COGS to CSV · Import CSV or Excel · History · Rollback · Saved filter presets · Settings and COGS health · FAQ

    Bulk edit WooCommerce product costs

    Step 1 — Open the redesigned bulk editor

    Go to Products → Bulk COGS Editor → Bulk edit. Version 1.3.1 arranges the workflow in three full-width sections: Select products, Set cost update, and Products & review. The editor follows your WordPress admin color scheme, and the active tab can be bookmarked or restored with browser Back and Forward.

    Editor tabWhat you can do
    Bulk editFilter products, calculate a cost adjustment, and review selections.
    Import / exportImport COGS from CSV or XLSX; export product costs as CSV.
    HistoryReview operation results, recorded changes, and eligible rollbacks.
    PresetsRename, edit, and delete your account’s saved product filters.
    SettingsChoose rollback defaults, retention, health notices, and recovery options.

    Step 2 — Find WooCommerce products and choose a cost action

    Search by product name, SKU, GTIN, ISBN, EAN, or UPC. Narrow the catalog by category or product type, then open More filters for stock status, brand, prices, or stored COGS. Click Find products to load the matches. You can filter costs that are:

    • Empty (no stored cost) or Zero (explicitly saved as 0).
    • Greater than zero, or Empty or zero together.
    • Greater than selling price (including an active sale price).
    • Greater than regular price (ignoring the sale discount).

    Price comparisons omit products that have no relevant selling price. Numeric ranges are also available for applicable COGS conditions. In Set cost update, choose to set an exact cost, increase or decrease by a fixed amount or percentage, or clear the saved cost. Variations can have separate cost records.

    Cost adjustmentExample starting at $10.00
    Set exact cost to $12.00$12.00
    Increase by 5.5%$10.55
    Decrease by 10%$9.00
    Increase by $2.00$12.00
    Decrease by $2.00$8.00
    Clear saved COGSNo stored cost

    Step 3 — Select matching products and edit the cost preview

    Compare Selling price, Regular price, Current COGS, New COGS, and each difference. Use Manage columns to customize the table, select individual rows, select all matches, or use Select a range for the first or last group of results. Selection must be explicit.

    Need an exception to the bulk adjustment? Select the pencil beside an individual New COGS value. Save it, cancel editing, or reset it to the Step 2 calculation. You can keep up to 500 individual overrides per bulk preview; they persist while navigating preview pages. Changing filters or the bulk cost action clears these overrides.

    Reset filters keeps your draft cost action, Deselect all products clears the selected rows, and Start over clears the filters, selection, action, and note.

    Step 4 — Review and confirm your WooCommerce COGS update

    Add an optional operation note and choose Review changes. Check the selected product count, the calculation, any individual overrides, and how many rows were inspected in the preview. Review coverage is not the same as the total selection.

    At confirmation, decide whether to Keep rollback history. When enabled, the plugin retains original costs and detailed change records for eligible rollback during your retention window. When disabled, it keeps operation results and retry protection but cannot roll back this update or show detailed item-level cost changes.

    Step 5 — Follow the background update progress

    Confirmed changes are applied in Action Scheduler batches. Watch processed, updated, skipped, and failed counts and elapsed time. Time remaining is only an estimate and may be unavailable until the worker has enough progress. You can leave the page and return later if the site’s background workers continue running.

    Stop remaining updates requests cancellation; costs already saved remain changed. The operation’s final result is the authoritative record.

    Step 6 — Check the completed bulk COGS operation

    Review the completion summary, including updated, skipped, and failed totals. You can inspect results or recorded changes when history was retained and begin a fresh update. Screenshot figures and durations represent individual example runs, not guaranteed timings.

    Export WooCommerce COGS to CSV and prepare a spreadsheet

    Step 7 — Choose product filters and CSV export columns

    Open Import / export → Export. Filter matching products and choose the export columns. Include at least one identifier—Product ID or SKU—so you can import the costs back accurately. Export reads existing product records and never changes costs.

    Export columnPurpose
    Product ID or SKUIdentify the intended product or variation on import.
    Product name and typeMake the spreadsheet easier to audit.
    Current COGSCompare the existing product cost.
    Regular and selling priceReview margin context.
    new_cogsLeave space to enter replacement costs for import.

    Step 8 — Review and confirm the export selection

    Inspect the selected products, product identifier column, and data fields. Confirm the CSV export only when the selection and columns are correct. This stage does not change WooCommerce products.

    Step 9 — Monitor CSV export preparation

    The export panel shows how the CSV file is being prepared. Keep the page open while it is built, and use Cancel export if you need to stop this download preparation.

    Step 10 — Download the completed CSV file

    After preparation finishes, click Download CSV. The elapsed time depends on your product count, server, and export configuration.

    Step 11 — Review the exported product cost spreadsheet

    Open the CSV in Excel or another spreadsheet editor. Keep the product IDs and SKUs unchanged, and use the stored COGS and price columns to check what should be updated.

    Step 12 — Enter new COGS values for import

    Add proposed costs to the new_cogs column. You can calculate supplier adjustments with spreadsheet formulas, but replace formulas with values before importing XLSX. Keep SKUs as text, especially if they contain leading zeros. The plugin will validate proposed costs before changing products.

    Import WooCommerce COGS from CSV or Excel (XLSX)

    Step 13 — Upload a CSV or Excel cost file

    Choose Import / export → Import, then upload a UTF-8 CSV or XLSX file. Check the file requirements and downloadable template. Your WordPress installation determines the maximum supported upload size.

    File requirementHow to prepare it
    IdentifierSupply id or sku; when both are present, they must match the same product.
    New costUse new_cogs; legacy cogs is accepted if new_cogs is absent.
    CSVUse UTF-8 and numeric cost values without currency symbols.
    XLSXUse the first worksheet and replace spreadsheet formulas with values.
    SKU formattingKeep SKUs as text to preserve leading zeros.
    Blank new_cogsThe row is skipped; a blank value does not clear the stored cost.

    Step 14 — Prepare and validate the import preview

    Click Validate file to prepare the import preview. The plugin checks rows in background batches without modifying costs. The progress is an estimate until all rows have been read. You can request Cancel preparation if you need to stop the validation stage.

    Step 15 — Review imported COGS and edit individual values

    Compare current costs, proposed New COGS, differences, and row readiness. Download validation error details for invalid rows. Click the pencil on a valid product’s New COGS to correct a staged cost; Save applies it to the preview, while Cancel leaves the staged value unchanged.

    Saved import edits persist across preview pages. Unlike the bulk editor, import preview overrides are not subject to the bulk 500-edit limit or the Reset to Step 2 action. Staging or editing a preview does not change any product cost.

    Step 16 — Confirm the imported product costs

    Select the products you intend to update, add an optional note, and click Review changes. Confirm the selected count, preview coverage, and staged cost values, then choose whether to keep rollback history. Without retained history, imported cost changes are not eligible for plugin rollback.

    Step 17 — Understand the import collection stage

    After confirmation, the plugin prepares the set of matched product records for the background update. Collecting or validating records is distinct from actually saving costs. Check the operation status before concluding that a product has been updated.

    Step 18 — Follow the confirmed import update

    The background operation then writes the selected COGS values in batches. Follow its processed, updated, skipped, and failed counts through the editor. You can return to the screen later, but Stop remaining updates does not undo already saved costs.

    Step 19 — Inspect the final import result and error reports

    Check the final operation counts and download a report if any products were skipped, failed, or unprocessed. A clean import with no such rows does not have an error report to download. Import duration varies by file size, selected products, hosting, and background workers.

    Import stageAre WooCommerce product costs changed?
    File export and spreadsheet editingNo
    Import upload, validation, and previewNo
    Collecting matching product recordsNot during the collection stage
    Confirmed background cost updateYes, as products are processed and saved
    Cancel remaining updatesPreviously saved changes are kept

    Review operation History and roll back eligible changes

    Step 20 — Find a completed COGS update in History

    Open History to review completed, cancelled, or failed operations. Filter by status, operation type, user, or dates, or search by operation ID, note, or product ID. The action-first layout helps distinguish adjustments, file imports, exports, and rollbacks.

    Step 21 — Examine the operation and its recorded product changes

    Click View details to inspect the selected operation. Check its type, status, product counts, author, note, duration, and recorded changes where available. History timestamps and rollback deadlines use your WordPress date and time formats and site timezone. You can return to the list while preserving its context or reopen a specific operation URL.

    Operations completed with No rollback history keep operation results but have no detailed item-level change log or rollback option.

    Step 22 — Review original COGS and rollback policy

    The rollback review compares Current COGS (now) with Rollback to (original). Check the retention deadline, effective policy, and any warning. Use Overwrite current costs when you need to restore recorded originals regardless of later edits, or Skip changed products to preserve later changes. Confirm only when the target records and policy are correct.

    Step 23 — Monitor rollback startup

    A rollback starts as a separate background operation. Return to History to inspect its startup status and total number of eligible records. An initial progress display may have no time estimate until workers advance.

    Step 24 — Track rollback progress

    Check updated, skipped, and failed totals as restoration batches finish. The remaining-time estimate can change or remain hidden until enough processing data is available. You may request cancellation, but it will not undo costs already restored.

    Step 25 — Check the near-completion status

    A nearly full progress bar is not proof that the rollback has finished. Review the actual status and recorded outcomes before starting another update or treating every original value as restored.

    Step 26 — Verify completed rollback results

    After the rollback completes, check its final outcomes and spot-check the intended products. Expired original cost records and operations without rollback history cannot be restored through this workflow.

    Save and manage reusable WooCommerce product filter presets

    Version 1.3.1 includes account-based filter presets for recurring product groups—such as suppliers, brands, categories, or products missing COGS. Presets save filter rules for your account on this site, so you can load them across browsers and devices. They do not save fixed product IDs, a cost action, or an automatic cost update.

    Save product filters as a preset

    1. Open Bulk edit and select the product filters.
    2. Expand Saved filters under Select products.
    3. Enter a unique name such as Hoodies — supplier review.
    4. Click Save filters.

    Load saved filters without updating costs

    Choose the preset under Saved filters and click Load filters. Click Find products to refresh matching products. Then configure the cost action and product selection for that run. Loading the preset alone never changes costs.

    Edit, rename, or delete presets

    In the new Presets tab, review saved names and creation dates. Choose Edit to rename or modify the filter rules, then save changes or cancel editing.

    Use Delete for one preset, or select several and delete them together after checking the confirmation. Deleting a preset never changes product costs.

    Upgrading from an older release? Existing browser-stored or user-meta presets are not migrated to the new account-based preset database. Recreate any filter rules you still need.

    Configure COGS settings, rollback defaults, and recovery

    Step 27 — Set history retention, rollback mode, and COGS health notices

    Open Settings, choose your defaults, and click Save settings. Your chosen Default rollback mode preselects Keep rollback history or No rollback history, and you can change that choice for each confirmed bulk update or import.

    SettingBehavior
    Default rollback modeChoose whether to retain original costs by default; override at confirmation.
    History retentionChoose 30 days, 90 days, or a custom period; shorter retention can also affect existing records.
    Overwrite current costsOn rollback, restore original costs even if changed later.
    Skip changed productsOn rollback, leave products with subsequent cost edits untouched.
    COGS health notice locationShow the notices only inside the editor or throughout WordPress admin.

    COGS health notices: The plugin scans published products and variations for missing costs or costs above the current selling price. Results are cached for approximately one hour, so changes may not appear immediately. Use Refresh now to request a background scan, or dismiss the notice for your account for one hour. A scan never changes costs.

    Step 28 — Recover from a stuck operation with force clear

    Use Force clear current operation only if normal cancellation cannot recover a stuck workflow. The confirmation warns that current operation and import references will be cleared and cancellation requested. A worker may continue briefly; already saved product costs are not reversed. History and rollback records remain available.

    For worker diagnostics, see the Action Scheduler administration documentation. Always check History before starting another update.

    ActionStops or clears the operation?Restores original costs?
    Stop remaining updates or cancel rollbackRequests cancellation; current batches may finish.No
    Force clear current operationClears current references and requests cancellation.No
    Confirmed eligible rollbackStarts a separate restoration job.Yes, if original values are retained and the rollback policy permits.

    WooCommerce COGS bulk editing: frequently asked questions

    Can I bulk change product costs without changing selling prices?

    Yes. Bulk COGS Editor works with WooCommerce’s native Cost of Goods Sold values. Its cost updates do not edit the store’s regular prices, sale prices, or existing order data.

    Does the plugin work with WooCommerce variable products?

    Yes. Products and their variations can carry separate costs, and variations are processed as separate records. Preview your selection before updating.

    Can I import product costs from Excel instead of CSV?

    Yes. CSV and XLSX uploads are supported. Use id or sku to identify products and new_cogs for new costs. Exports are CSV.

    What happens if I disable rollback history?

    The update still records its result and protects against repeated processing, but it does not retain original item costs for rollback or the detailed change history. Choose the rollback mode carefully at confirmation.

    Are saved filter presets shared between devices?

    Yes, for the same WordPress user account on the same site. Presets save the filtering rules, not the proposed cost action or an automatically scheduled update.

    Does the plugin require WP-CLI for large COGS updates?

    No. WooCommerce’s normal Action Scheduler runner can process the updates. WP-CLI is optional for stores whose operators want to run queued batches from the command line.

    Start managing WooCommerce COGS safely

    Version 1.3.1 adds a clearer three-stage editor, reusable filter presets, inline cost corrections, optional rollback history, and background-cached COGS health notices. For a first run, filter a small product group, preview proposed costs, keep rollback history, then confirm and monitor the results.

    Download Bulk COGS Editor for WooCommerce on WordPress.org. You can also review the source and release history on GitHub. For another WordPress administration utility, see Quick Plugin Switcher.