How Gatemi Product Feed Works

A product feed is a list your ad channel reads every day. Getting it wrong costs more than a missing product: rows Merchant Center rejects, or values that break its policies, can get an account suspended. Four rules govern how the plugin builds a feed.

1. Nothing is held in memory

A build reads published products 200 at a time through WooCommerce's own wc_get_products() query, in ID order, and writes each row to the file as it goes. The whole catalog is never loaded at once, so a large store builds the same way as a small one. Full edition: the batch size is the gmpf_batch_size filter.

2. A half-written feed is never served

Rows are written to a temporary file next to the real one (the same name with .writing on the end). When the last row is written, the temporary file is renamed over the real one in a single move. A channel fetching in the middle of a build gets the previous complete feed, never the first thousand rows of the new one. If the move fails, the temporary file is deleted and the old feed stays.

3. A product that cannot fill a required field is left out and counted

Each channel has required fields. A product that cannot fill one of them is not written at all, and the left out count goes up by one.

Channel Required fields
Google Shopping id, title, link, image_link, price, availability
Microsoft (Bing) Shopping — Full edition the same as Google
Meta — Full edition id, title, description, availability, condition, price, link, image_link, brand

A row missing its price or image is a row the channel would reject days later, with no easy way back to the product. Leaving it out and counting it tells you at build time.

4. A field a product cannot fill is omitted, never guessed

An optional field with no value — no brand, no sale price — is simply left off the row. The plugin never writes a placeholder. A blank brand is a warning in Merchant Center; an invented one is a policy problem.

Where each field comes from

Feed field From
id The SKU, or the product ID when there is no SKU.
title The product name, plain text, cut to 150 characters.
description The short description, or the full description when the short one is empty. Shortcodes and HTML are stripped; cut to 5,000 characters.
link The product's permalink.
image_link The product image at full size.
availability in_stock, out_of_stock, or backorder — Google's words, not WooCommerce's.
price The regular price (or the current price when there is no regular price), with the store currency, e.g. 24.00 GBP. A price of 0 counts as missing.
sale_price The sale price, when there is one.
brand The first term of WooCommerce's Brands taxonomy (product_brand).
condition new. Full edition: refurbished or used when set with the product's Condition field (_gmpf_condition).
product_type The product's categories, joined with >.
item_group_id On a variation, the parent's SKU or ID.

Full edition adds, for Google: additional_image_link (up to 10 gallery images, comma separated), gtin, mpn (the MPN field, or the SKU when it is blank), google_product_category and shipping_weight (the weight with the store's weight unit). Microsoft also gets mpn; Meta also gets google_product_category.

Variable products

The parent of a variable product cannot be bought — only its variations can, each with its own price, image and stock. So a variable product is sent as its variations, each its own row, tied together by item_group_id. A variation whose Enabled box is unticked is never sent: nobody can choose it on the product page. Full edition: with Send each variation as its own row off, a feed leaves variable products out instead.

Hidden products

A product whose Catalog visibility is Hidden is in no listing and no search result on your shop, so it is not sent either. One shown in search results only is still sent. Neither a hidden product nor a disabled variation counts as left out.

Rebuilding on a schedule

Free edition: with Keep this feed up to date ticked and Rebuild on Daily, one cron event, gmpff_generate, rebuilds the feed once a day. Unticking Keep this feed up to date removes the event, and a run already queued builds nothing. A build that fails writes its reason to last_error, shown on the screen.

Full edition: there is one cron event per schedule, not per feed: gmpf_generate with hourly, twicedaily or daily as its argument. When it fires, every Active feed on that schedule is rebuilt in turn. Six daily feeds are one rebuild run, not six racing each other through the same folder. An event exists only while some active feed uses that schedule.

WordPress cron runs when the site gets visits. On a quiet site, or with DISABLE_WP_CRON set, set up a real server cron so the feed is rebuilt on time.

The files

Feeds live in wp-content/uploads/gmpf-feeds/, a folder created with an empty index.html so it cannot be browsed. The file names carry a random code, because the files must be public for the channel to fetch them and a predictable name would hand your catalog to anyone who guessed it.

Shopping Cart
Scroll to Top