@singhmc What dictates whether a page/post or product is shown in it’s corresponding sitemap can be set both on a global level (meaning the default setting for all pages/post that are part of that content type or taxonomy) and also be set on an individual level from the Yoast meta box on the ‘Edit’ screen for that page/post/product.
In both ways this setting is changed by modifying the ‘Show in search results’ setting to either ‘Yes’ (this sets the robots meta tag to a value of index
, and means the page/post/product will have it’s URL included in the sitemap) or ‘No’ (this sets the robots meta tag to a value of noindex
, and means the page/post/product will NOT have it’s URL included in the sitemap).
We would recommend checking to make sure the robots meta tag is NOT set to noindex
for the hidden product in Yoast SEO, and you can change this setting by performing the following actions to change setting on an individual page/post/product:
? Go to the Edit screen for the product
? 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 ‘Yes’
* Note (setting this value to Yes will set meta robots to index
and include it’s URL in the sitemap)
In addition, you can set pages/posts, products, and taxonomies to be indexed and included in the sitemap as the default for their entire type globally by performing the following actions:
? In WordPress go to Yoast SEO>Search Appearance>Content Types (or Taxonomies if you are trying to affect a change to a Taxonomy type)
? For the corresponding content type set ‘Show in search results’ to ‘Yes’
? Click ‘Save Changes’
We also have additional information on this topic in the How do I noindex URLs? and the How do I customize the sitemap index? articles.