Woocommerce products
-
Is there a possibility to put Woocommerce products all on noindex? Unfortunately, do not find this option in the plugin
-
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 🙂
Thanks for your feedback, Maybe a silly question from me but where do I have to insert this code? 🙂 Thank you in advance
Hi Perez,
Here’s a list of locations where you can put the code:
https://theseoframework.com/docs/using-filters/#whereP.S. in v3.1 post-type specific index options are added. The update’s almost ready 🙂
Hi Sybre,
Thanks, when is the update coming, can you say it?
1 – 4 – 8 weeks? :))Hi Perez,
The ETA is 2 to 4 weeks.
Note that the upcoming option will also apply
noindexto product categories and tags. If you don’t want that, you’d be better off applyingnoindexto each product manually. Or, use the filter in extreme cases instead.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?
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/345Until 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.
The topic ‘Woocommerce products’ is closed to new replies.