• Resolved perez21989

    (@perez21989)


    Is there a possibility to put Woocommerce products all on noindex? Unfortunately, do not find this option in the plugin

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @perez21989,

    Post-Type-specific SEO settings aren’t available yet. However, there are plenty of filters available that’ll do the trick.

    With this, you’ll be removing all your products–and price listings–from Google and other sites. I hope you know what you’re doing and that you’re confident about this.

    add_filter( 'the_seo_framework_robots_meta_array', function( $robots = array() ) {
    
    	if ( the_seo_framework()->is_wc_product() ) {
    		//? Key and value are the same, legacy reasons.
    		$robots['noindex'] = 'noindex';
    	}
    
    	return $robots;
    }, 10, 1 );

    The filter’s usage isn’t reflected in the SEO Bar. You’ll need to look at the page HTML-source to see whether it’s working.

    Cheers 🙂

    Thread Starter perez21989

    (@perez21989)

    Thanks for your feedback, Maybe a silly question from me but where do I have to insert this code? 🙂 Thank you in advance

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Perez,

    Here’s a list of locations where you can put the code:
    https://theseoframework.com/docs/using-filters/#where

    P.S. in v3.1 post-type specific index options are added. The update’s almost ready 🙂

    Thread Starter perez21989

    (@perez21989)

    Hi Sybre,
    Thanks, when is the update coming, can you say it?
    1 – 4 – 8 weeks? :))

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Perez,

    The ETA is 2 to 4 weeks.

    Note that the upcoming option will also apply noindex to product categories and tags. If you don’t want that, you’d be better off applying noindex to each product manually. Or, use the filter in extreme cases instead.

    Thread Starter perez21989

    (@perez21989)

    I know that from Yoast so that I could set Global Noindex for all products, the products I wanted to have indexed then I changed manually on the product page to index, as well as on category pages. Will it be so similar?

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Perez,

    We might ever implement such a feature. But, it’s then a two-(or three-)way street, which requires a lot of maintenance and preparation. We need to upgrade our binary checkboxes to dropdowns, that include “Default, On, Off” options.

    In fact, this is a great idea that didn’t come to mind earlier! I’ve escalated your suggestion to be implemented in a future release:
    https://github.com/sybrew/the-seo-framework/issues/345

    Until then, I recommend choosing one of these with The SEO Framework:

    • Want to exclude a complete post type? Apply noindex for the post type.
    • Want to exclude most/some posts of the post type? Apply noindex to those posts individually.

    I know the second option is very time-consuming. There are programmatic ways around this, but you’ll be much better off when using the user interface in the long run.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Woocommerce products’ is closed to new replies.