---
title: "Product XML Feeds: Developer Hooks and Filters Reference"
description: "Developer reference for WooCommerce product XML feeds: filters, actions and generating a feed programmatically."
url: "https://wpfactory.com/docs/product-xml-feeds-developer-hooks-filters/"
updated: "2026-09-27"
category: Developers
---

# Product XML Feeds: Developer Hooks and Filters Reference

[Product XML Feeds Manager for WooCommerce](https://wpfactory.com/item/product-xml-feeds-woocommerce/) exposes a small, focused set of filters and actions so you can change gating, override per-feed values, extend the `[alg_product_function]` allow-list, and hook the feed-generation lifecycle in code, without editing plugin files.

All option ids referenced below live under **WPFactory > Product XML Feeds** (also reachable at **WooCommerce > Settings > Product XML Feeds**). Per-feed options carry the feed number as a suffix, for example `alg_products_xml_header_1`.

### Filters

| Filter | Passed | Purpose |
| --- | --- | --- |
| `alg_wc_product_xml_feeds_settings` | `$value`, `$type` | The Pro gating filter. In Pro it returns an empty value (unlocking a field); in Free it returns the passed `disabled`/`readonly` array. Used on the feed count cap and every Pro option. |
| `alg_wc_product_xml_feeds_values` | `$value`, `$type`, `$file_num` | Resolves per-feed values by `$type` (for example `total_number`, `update_interval`, `stock_status`, `min_price`, `max_price`, `catalog_visibility`, `product_type_include`, `custom_meta_incl`). Filter it to override a value in code. |
| `alg_wc_product_xml_feeds_shortcode_allowed_functions` | `$functions` (array) | The allow-list of `WC_Product` methods that `[alg_product_function function="..."]` may call. Add a method name to expose it. |
| `alg_allowed_custom_functions` | `$functions` (array) | The allow-list for the global `custom_function` shortcode attribute. Only listed, existing functions are called on the shortcode result. |
| `alg_shortcodes_list` | `$shortcodes` (array) | The registered shortcode names. Useful for tooling that lists available tags. |

### Actions

| Hook | Fires |
| --- | --- |
| `alg_wc_product_xml_feeds_create_products_xml_hook_{n}` | The scheduled (WP-Cron) event for feed `{n}`. It runs `create_products_xml( $file_num )` on the selected interval. You can trigger or reschedule it programmatically. |

### Generating a feed programmatically

Two entry points regenerate a feed on demand:

- **Admin URL**: `?alg_create_products_xml={n}` with a valid `_wpnonce` (nonce action `alg_create_products_xml_nonce`). Requires the `manage_woocommerce` capability. This is what the **Create now** button uses.
- **External AJAX action**: `admin-ajax.php?action=alg_wc_product_xml_feeds_generate_xml_external&alg_create_products_xml={n}&secret=...`. The `secret` must equal `wp_hash()` of your Security Key (`alg_products_xml_feeds_security_key`). This is the URL embedded in the Manual Cron Job Command.

```
// Expose an extra WC_Product method to [alg_product_function].
add_filter( 'alg_wc_product_xml_feeds_shortcode_allowed_functions', function ( $functions ) {
    $functions[] = 'get_weight';
    return $functions;
} );
```

```
// Register a custom_function target for shortcodes: [... custom_function="my_uppercase"].
add_filter( 'alg_allowed_custom_functions', function ( $functions ) {
    $functions[] = 'my_uppercase';
    return $functions;
} );
function my_uppercase( $value ) {
    return strtoupper( $value );
}
```

### Notes

- The value filter name is `alg_wc_product_xml_feeds_values` (with the `alg_` prefix). If you are extending Pro-only values, hook that exact name.
- The `custom_function` and `[alg_product_function]` allow-lists exist for security: arbitrary function names are ignored unless allow-listed. Keep your additions to safe, read-only functions.

### Need a hand?

For implementation questions, our team answers every ticket on the [Product XML Feeds support forum](https://wpfactory.com/support/item/product-xml-feeds-woocommerce/).

Related articles

- [Filter Products and Schedule a Product XML Feed](https://wpfactory.com/docs/feed-1-advanced-setup/)
- [How to Add WooCommerce Brands to a Product XML Feed](https://wpfactory.com/docs/xml-feed-woocommerce-brands/)
- [How to Create a WooCommerce Product XML Feed: Getting Started](https://wpfactory.com/docs/intro-how-to-use-woocommerce-product-xml-feeds-manager/)
- [Shortcodes Guide for Product XML Feeds](https://wpfactory.com/docs/woocommerce-xml-feeds/)
- [Configuring WooCommerce Product XML Feed #1](https://wpfactory.com/docs/configuring-woocommerce-feed/)
