Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter serge rauber

    (@kalyx)

    For those who are interested, here is a hook to put in functions.php

    // supprime les produits "cachés" du sitemap xml
    add_filter('seopress_sitemaps_single_query', function( $args, $path ) {
    	if ( $path == 'product' ) {
    		$args['tax_query'][] =
                array(
                    'taxonomy' => 'product_visibility',
                    'field'    => 'slug',
            		'terms'    => array('exclude-from-catalog'),
    				'operator' => 'NOT IN',
                );
    	};
    	return $args;
    },10,2);
    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    thank you for this feedback.

    We’ll fix this in our next major update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hidden products in sitemap’ is closed to new replies.