Title: Attribute mapper postmeta performance problems
Last modified: February 23, 2026

---

# Attribute mapper postmeta performance problems

 *  [Jason](https://wordpress.org/support/users/galapogos01/)
 * (@galapogos01)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/attribute-mapper-postmeta-performance-problems/)
 * Hello Devs,
 * It has come to my attention that the attribute mapper feature in Facebook for
   WooCommerce **copies** attributes already configured against the product (eg.
   pa_colour), creates a new custom attribute (eg. fb_colour) and **populates it
   with the same information**. It does this for each attribute mapped (ie. n times).
 * We have over 7k products each with multiple attributes and this code is duplicating
   each attribute for each product (ie. n * num_products). As you’d know, postmeta
   is one of the hottest tables in WooCommerce and adding additional postmeta for
   no reason is wasteful.
 * What developer thought this was a good idea?
 * Why would you not use the mapping to pull existing attributes?
 * When can this be fixed?
    -  This topic was modified 3 months, 1 week ago by [Jason](https://wordpress.org/support/users/galapogos01/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Jason](https://wordpress.org/support/users/galapogos01/)
 * (@galapogos01)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/attribute-mapper-postmeta-performance-problems/#post-18830268)
 * Worse still; the plugin sets 13 postmeta records for each product, even when 
   the mapping is empty!
    - fb_age_group
    - fb_brand
    - fb_color
    - fb_gender
    - fb_material
    - fb_mpn
    - fb_pattern
    - fb_product_condition
    - fb_product_description
    - fb_product_video
    - fb_rich_text_description
    - fb_size
    - fb_visibility
 * This is madness — can you advise how this can be stopped?
 *  Thread Starter [Jason](https://wordpress.org/support/users/galapogos01/)
 * (@galapogos01)
 * [3 months, 1 week ago](https://wordpress.org/support/topic/attribute-mapper-postmeta-performance-problems/#post-18833019)
 * For anyone following — this patch bypasses saving the superfluous meta:
 *     ```wp-block-code
       --- a/facebook-commerce.php+++ b/facebook-commerce.php@@ -1004,6 +1004,8 @@ 	 * @param WC_Facebook_Product $woo_product The Facebook product object 	 */ 	private function save_facebook_product_attributes( $woo_product ) {+		// Disabled: rely on defaults.+		return; 		// phpcs:disable WordPress.Security.NonceVerification.Missing 		if ( isset( $_POST[ WC_Facebook_Product::FB_BRAND ] ) ) { 			$woo_product->set_fb_brand( sanitize_text_field( wp_unslash( $_POST[ WC_Facebook_Product::FB_BRAND ] ) ) );
       ```
   
 * Would love to see a proper fix to this in core; only save them if populated, 
   for example! Think of your poor customers’ performance…
 *  Plugin Support [Marija](https://wordpress.org/support/users/marijastuntcoders/)
 * (@marijastuntcoders)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/attribute-mapper-postmeta-performance-problems/#post-18854231)
 * Hi [@galapogos01](https://wordpress.org/support/users/galapogos01/) – thank you
   for reaching out!
 * We have prioritized this issue, and the team is looking into it. We will let 
   you know as soon as we have an update.
 * Kind regards,
   Marija
 *  Thread Starter [Jason](https://wordpress.org/support/users/galapogos01/)
 * (@galapogos01)
 * [2 months, 2 weeks ago](https://wordpress.org/support/topic/attribute-mapper-postmeta-performance-problems/#post-18854692)
 * Thanks [@marijastuntcoders](https://wordpress.org/support/users/marijastuntcoders/)
 * I found I also had to patch these methods to avoid further superfluous meta records
   being created:
 *     ```wp-block-code
       --- a/facebook-commerce.php+++ b/facebook-commerce.php@@ -1071,6 +1071,8 @@         * @since 1.10.0         */        private function save_product_settings( WC_Product $product ) {+               // Disabled: rely on defaults.+               return;                $woo_product = new WC_Facebook_Product( $product->get_id() );                 // phpcs:disable WordPress.Security.NonceVerification.Missing
       ```
   
 * And
 *     ```wp-block-code
       --- a/includes/Products.php+++ b/includes/Products.php@@ -299,6 +299,9 @@         * @return bool success         */        public static function set_product_visibility( \WC_Product $product, $visibility ) {+               // Disabled: rely on default (visible).+               return true;+                unset( self::$products_visibility[ $product->get_id() ] );                if ( ! is_bool( $visibility ) ) {                        return false;
       ```
   
 * These patches are just butchering methods to avoid creating meta records. It 
   would be excellent to see the plugin **properly **updated to avoid creating these
   records where the product is just using default values. ie. where the value is
   not set, the plugin should skip saving a meta.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fattribute-mapper-postmeta-performance-problems%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/facebook-for-woocommerce/assets/icon.svg?rev=3469606)
 * [Meta for WooCommerce](https://wordpress.org/plugins/facebook-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-for-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jason](https://wordpress.org/support/users/galapogos01/)
 * Last activity: [2 months, 2 weeks ago](https://wordpress.org/support/topic/attribute-mapper-postmeta-performance-problems/#post-18854692)
 * Status: not resolved