-
When i activated the plugin, wordpress said this:
The plugin generated 428 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
I saw in the header in the plugins page after activating the plugin this;
specific categories */ add_filter( ‘rank_math/frontend/robots’, function ( $robots ) { $categories = array_map( function ( $category ) { return $category->slug; }, get_the_category() ); //Replace your_category with your category slug. if ( in_array( ‘donotallowpost’, $categories ) ) { unset( $robots[‘index’] ); $robots[‘noindex’] = ‘noindex’; } return $robots; } );
My Query monitor reported the data in the Sensitive data section
I also have a rank-math.php in my theme directory
/**
* Filter to set noindex to specific categories
*/
add_filter( 'rank_math/frontend/robots', function ( $robots ) {
$categories = array_map( function ( $category ) {
return $category->slug;
}, get_the_category() );//Replace your_category with your category slug.
if ( in_array( 'donotallowpost', $categories ) ) {
unset( $robots['index'] );
$robots['noindex'] = 'noindex';
}
return $robots;
} );
You must be logged in to reply to this ticket.