• Hi there,

    how can I remove the shop page from the sitemap?
    I didn’t assign any shop page in Woocommerce settings but still WordPress create it and Yoast add it to the product-sitemap.xml.

    Thanks

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Suwash

    (@suascat_wp)

    @gamma42

    We understand you want to remove the shop page from the sitemap. However, upon checking the product sitemap https://nnhotempo.it/product-sitemap.xml we are no more seeing the shop page. Have you managed to remove it already?

    If you want to remove the page just from the sitemap, but yet want it to be indexed in the search engines, you or your developer can also use a filter to bulk exclude posts or pages from the Yoast SEO sitemap.

    Thread Starter marcello.brunaldi

    (@gamma42)

    Hi there,

    I have managed it adding this piece of code:

    /**
     * Removes the shop from sitemap
     */
    add_filter( 'wpseo_sitemap_post_type_archive_link', 'my_wpseo_cpt_archive_link', 10, 2);
     
    function my_wpseo_cpt_archive_link( $link, $post_type ) {
    
            // Disable product/post archives in the sitemaps
            if ( $post_type === 'product' )
                    return false;
    
            return $link;
    }

    I would like to take this opportunity to ask you whether it is correct although it works and whether there are any contraindications for future updates.

    Plugin Support Suwash

    (@suascat_wp)

    @gamma42 as long as you’re aware of the purpose of hiding the shop page from the sitemap the given piece of code is fine. Although being hidden from the sitemap, search engines will still be able to crawl and index your shop page. If you want to entirely noindex this page, please follow this guide https://yoast.com/help/how-do-i-noindex-urls/

    Thread Starter marcello.brunaldi

    (@gamma42)

    Hi there,

    following the guide you sent me, I couldn’t find any suggestion to noindex a shop page. Since the shop page is created by default I can’t edit it and I couldn’t find any option for listing it as noindex in Search Appearance.

    Plugin Support devnihil

    (@devnihil)

    @gamma42 Thanks for your reply.

    Regarding the shop page, which of of your site’s page’s is used by WooCommerce for the Shop page is configured in the WooCommerce setting for ‘Shop Page’ which is located in WordPress under WooCommerce>Settings>Products.

    To set the page that is configured as your Shop page to noindex, you would need to perform the following steps:

      ? Go to the Edit screen for the Shop page by going in WordPress to Pages>All Pages and then clicking the ‘Edit’ link beneath the page that is indicated as the ‘Shop Page’ (see image here).
      ? Scroll down to the Yoast metabox
      ? Click on the ‘Advanced’ area
      ? For ‘Allow search engines to show this Page in search results?’ make sure this is set to ‘No’
      * Note (setting this value to Yes will set meta robots to index and setting No would set meta robots to noindex)
      ? Click ‘Update’

    We also have a guide on how to set a page/post to noindex here: https://yoast.com/help/how-do-i-noindex-urls/

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Shop page – sitemap’ is closed to new replies.