• Resolved Jim

    (@jwmc)


    Some pages on our site (such as cart, my-account, checkout) are getting a noindex tag from somewhere (not from SEO Framework settings). This actually seems to make sense, as why index pages like that?

    However, they are in the sitemap.xml, and Google’s Search Console doesn’t like to be told about them and then find noindex. I can’t find a way to exclude them from the sitemap. Am I missing something?

    Thanks!

    Edit – I found the filtering method, but it doesn’t seem to work. Should the sitemap be regenerated on the fly each time it is requested? Here’s my filtering:

    add_filter( 'the_seo_framework_sitemap_exclude_ids', 'cc_sitemap_excludes' );
    function cc_sitemap_excludes() {
    	$ids = array( 5, 6, 7, 35 );  
    	return $ids;
    }
    
    • This topic was modified 6 years, 9 months ago by Jim.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jim

    (@jwmc)

    OK, finally I found about resetting the sitemap cache by changing a plugin setting and saving. It works now!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @jwmc,

    I’m glad you’ve been able to fix it yourself so quickly. ??

    However, it’s best to set “noindex” for those pages via TSF, so you won’t have to fiddle with the code. The “noindex” option effectively removes the pages from the sitemap.

    WooCommerce also sets “noindex” for those pages–it’s a self-resolving conflict I found recently, and no further action is required.

    Updating any page, or saving the SEO settings (as you found out) will flush the sitemap.

    Cheers ??

    Thread Starter Jim

    (@jwmc)

    Ahh, I see. I didn’t know that setting noindex in TSF would remove them from the sitemap. And apparently I would set noindex in TSF even if WooCommerce also does it, just to keep them out of the sitemap.

    Actually I found a bunch of additional pages that would be bad landing pages or make no sense to index, so I added those too.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude pages from sitemap?’ is closed to new replies.