BEAR - WooCommerce Bulk Editor and Products Manager Professional

WooCommerce product CSV export not working: fixes for BEAR exports

When the WooCommerce product CSV export is not working in BEAR, the symptom tells you where to look: the export buttons do nothing, the progress bar never moves, the downloaded file is empty or out of date, the file holds more products than the filter showed, or Excel opens it with broken letters. Each of these has its own cause, and exporting again fixes none of them. Below is how an export runs, then the fix for each symptom.

How a BEAR export runs

The Export tab works through a series of requests to admin-ajax.php:

  1. Start. The server deletes the earlier export files, creates a new file with the header row in wp-content/plugins/woo-bulk-editor/ext/export/__exported_files/ and, when no products are ticked, sends back the IDs of the products that match the current filter.
  2. Rows. The browser sends the products in portions of ten. The server appends their rows and adds the variations of variable products. The progress bar counts these portions.
  3. Download. After the last portion the download CSV (or download XML) button appears. It does not link to the file: it asks the server, which checks your permission and sends the file. The folder itself is closed to the web.

Every export gets its own file name: woobe_exported_, the date and time, and a random-looking tail. The columns are the ones active in the Settings tab for your user, in the same order. The notice at the top of the tab, Export will be applied to, names the products the file will contain.

The export buttons do nothing

If a click on Export to CSV does nothing, or hides the buttons and stops, a JavaScript error interrupted it. Press F12, open the Console tab, click the button again and read the red line.

lang.export is undefined (Firefox) or Cannot read properties of undefined (reading 'export_is_going') (Chrome) has a specific cause. BEAR keeps its interface texts in a global JavaScript object named lang, and the Export tab adds its own texts to it. A theme or another plugin that declares its own global lang later on the same page replaces BEAR's object, and the export texts go with it. To confirm, type typeof lang.export into the console: it must answer "object". Then find the script that overwrites it: deactivate plugins one by one on a staging copy, or keep the culprit away from the editor permanently as described in isolating plugins during bulk edits. Do not edit BEAR's export.js to remove the texts: the next update restores the file.

Other red errors from another plugin or theme can stop the editor's scripts too. If the whole editor misbehaves, start with the bulk editor not loading.

The export never finishes, fails with error 500 or downloads an empty file

When PHP cannot write the export folder, the current version stops without an error message, and what you see depends on how you exported:

  • With a filter or the whole catalogue: the progress bar stays empty, only cancel export is visible and the Exporting ... message never goes away.
  • With ticked products: the tab says Exported and shows the download button, but the downloaded file is empty, often saved as admin-ajax.htm.

The first picture also appears when the filter matches no products, so check the count under the table first. Older versions stopped with HTTP 500 and this line in the PHP error log: fputs(): Argument #1 ($stream) must be of type resource, bool given in ext/export/export.php. The cause is the same: the file could not be opened for writing. Update BEAR, then fix the folder.

It happens mostly after a move to another host or a backup restore, when the files belong to a different system user than the one PHP runs as. Other causes: managed hosting that keeps the plugins folder read-only on the live site, a full disk quota, an open_basedir restriction. To fix it:

  1. Open wp-content/plugins/woo-bulk-editor/ext/export/ in the hosting file manager or over FTP. BEAR creates __exported_files by itself when it is missing, if it is allowed to.
  2. Make sure the folder is owned by the user PHP runs as and has permissions 755 (files 644). If you cannot change ownership, ask the host to allow PHP to write there.
  3. Check the disk quota of the hosting account.
  4. If the folder is writable and the export still fails, turn on the debug log in wp-config.php and read wp-content/debug.log after the next attempt:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Put these lines above That's all, stop editing and remove them when you are done. The WordPress debugging guide explains them.

The download is empty, out of date or has the wrong columns

  • The file is gone. Export files are deleted 8 hours after they were written (since version 2.2.3), and every new export deletes the earlier files. The folder is shared, so a colleague's export removes yours too. Download right after the export finishes, and run exports one at a time.
  • The page is too old. The download link carries a WordPress security token created when the editor page loaded. Such tokens are valid for 12 to 24 hours; after that the server sends nothing and the browser saves an empty file. Reload the editor and export again.
  • The same old file every time. Older versions downloaded the file straight from the plugin folder, where a server or CDN cache could hand out an earlier copy. Since 2.2.3 every export has a new name and comes through admin-ajax.php with no-cache headers. If you still get an old file, update BEAR and make sure no cache rule covers /wp-admin/ or /wp-admin/admin-ajax.php.
  • Wrong or missing columns. The file has exactly the columns active in Settings for the logged-in user, whatever the Bulk Edit or Filters tabs show. Switch the columns on, save, reload the editor and export again. Save the set as a columns profile if you need it often.

Some columns differ from the editor on purpose, because the file follows the WooCommerce product importer format: each attribute becomes four columns (Attribute 1 value(s), Attribute 1 name, Attribute 1 visible, Attribute 1 global), a meta field becomes Meta: plus its key, and a Parent column is added whenever an attribute column is active. The importer matches columns by name, so their order does not matter for import.

More products or more variations than the filter showed

The export follows a fixed priority: ticked products first, then the current filter, then all products. If you ticked rows earlier and forgot about them, the notice says the selected products (variations); clear them with the uncheck button on the tools panel. If the notice says the filtered products but the file holds the whole catalogue, the filter was lost on the server between requests. The count under the table jumps in that case, and the fix is in bulk editor filter not working.

Variations work differently. The filter selects products; the export then adds every variation of each matching variable product. A condition such as a stock of 1 or more does not remove the variations that have none. To narrow the variation rows:

  • Switch on variations on the tools panel. The Export tab then shows an attribute combination picker: choose the attributes, press Add attributes combination, pick the values and set In or Not in. A combination must name every attribute of the variation exactly.
  • Or tick only the variation rows you want (select all variations helps) and export the selection.
  • Or leave out the variations that cannot be sold from stock with a hook:
// Child theme functions.php or a code snippets plugin.
// BEAR export: skip variations that are not in stock.
add_filter( 'woobe_export_cut_empty_variations', '__return_true' );

With it, the export skips variations whose stock status is not In stock (on backorder included) and variations that manage stock with a quantity of 0 or less. Simple products and parent rows are not affected. For other changes to the exported values there is the woobe_export_product_fields_answer filter, listed on More settings (implicit).

In version 2.2.4 the attribute columns of variation rows are written empty; the values appear on the parent row only. Add the Title column to tell variations apart (see variation titles with attributes if yours do not show them), and edit variations in the editor rather than rebuilding them from this file with the WooCommerce importer.

Excel shows broken letters, wrong prices or codes like &

The file is written in UTF-8 without a byte order mark. Excel opens such a file on double-click with the computer's regional code page, so Greek, Cyrillic and accented letters turn into nonsense, although the file is correct: Google Sheets and LibreOffice Calc show it properly. In Excel use Data → From Text/CSV, set File origin to 65001: Unicode (UTF-8) and choose the delimiter you exported with.

  • Delimiter. The drop-down next to the export buttons offers , ; | ^ and ~. A file for the WooCommerce importer must use a comma; a semicolon is handier only for viewing in Excel where the list separator is a semicolon.
  • Prices. Prices are exported as stored numbers with a dot, such as 29.90. The comma you see in the shop is the display format of the currency. In a comma-decimal locale, press Transform Data in the import dialog and set the price columns with Change Type → Using Locale to English (United States).
  • SKUs and codes. Excel removes leading zeros and turns long numbers into 1.23E+12; set such columns to Text in the same dialog. A SKU that contains a dash-like character other than the plain hyphen, typically pasted from a document, keeps that character in the file; replace it with a hyphen in the shop.
  • Entities. Attribute values go through WordPress display formatting, so & appears as & and an apostrophe can appear as ’. Titles and other texts are written as stored. Replace the entities with Find and Replace before you reuse the file.
  • Coded values. Status is 1 for published, -1 for draft and 0 for private; Stock status is 1 for in stock and 0 for anything else; upsells and cross-sells are listed by SKU, or as id:123 for products without one.

Checklist

  1. BEAR is up to date, and typeof lang.export answers "object" in the console of the editor page.
  2. ext/export/__exported_files in the BEAR folder is writable by PHP.
  3. The Export will be applied to notice names the products you expect, and the count under the table does not jump.
  4. The file is downloaded right after the export, from an editor page loaded the same day.
  5. Excel opens it through From Text/CSV with UTF-8.

If the export still fails, open a topic on the BEAR support forum with the BEAR version, what the tab shows after the click, and any console error or debug.log lines.