Support » Plugin: Sitemap with woocommerce » Show only public available posts

  • I want the sitemap to only show
    products and categories that are available to the current user.
    Furthermore, to show only categories, that have actual products in them.

    Is that possible?

    The page I need help with: [log in to see the link]

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


    Since I dont see an exclude function for Woocommerce product categories, I solved it by adding


    For products I added:

    			while ( $loop->have_posts() ) : $loop->the_post(); 
    			$post_id = get_the_ID();
    			$post = get_post( $post_id );
    			$product = wc_get_product( $post_id );
    			if($product->is_visible() && empty($post->post_password)){			
    				<li><?php the_title( '<a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a>' ); ?></li>

    This will hide not visible products and password protected posts.
    Maybe you can add it.

    Plugin Author omsuhani


    i have resolved you problem password protected product restrict to display in sitemap

    thank for suggestion

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show only public available posts’ is closed to new replies.