Hello,
Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.
Please use the filter given below in your theme’s functions.php file to remove the product attributes from the titles & meta settings:
add_filter( 'rank_math/settings/title', function( $titles ) {
$titles = array_filter( $titles, function( $title ) {
return ! isset( $title['taxonomy'] ) || strncmp( $title['taxonomy'], 'pa_', 3 ) !== 0;
} );
return $titles;
} );
And before applying the filter, click on the product attributes and enable the Robots Meta option, and set it as noindex:
Hope this helps. Let us know if you need any other assistance.
Thank for support. The code removed attributes. But if a new attribute added then it’s may not be possible to set that as noindex. In that case an easy setting required to set noindex for all attributes at once. It will be great if this feature added in future versions.
Hello,
You can easily fix this by not checking the Enable Archives? option while creating the attributes.
When this option is not checked, the attributes are not added to Titles & Meta settings and the archives are also not created for them. Hence, Google would not index them.
Hope this helps.
Thank you.
Yes, this is the easy way. But I only import affiliate poducts for my site and the attributes will generate automatically. So its better to use global attributes disable setting..
Hello,
Yes, if the attributes are being generated automatically then it is better to use the filter to disable them from being included in the titles & meta settings. And since they are not being added in the titles & meta settings, they should be set to noindex.
Hope this helps. Let us know if you need any other assistance.
Thanks.