Robots.txt custom field

#362662
  • Resolved Jibsoux
    Rank Math free

    Hello team!
    I come to you because I can’t find the possibility for the metarobot global setting to add “noodp,noydir”.
    thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Those meta robots values are not available on the Global settings in Rank Math’s Titles & Meta settings.

    However, you can use and customize this filter to add them to your site:

    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    		$robots['noodp'] = 'noodp';
    		$robots['noydir'] = 'noydir';
    	        return $robots;
    });

    The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    I hope that helps.

    Thank you.

    Thank you for the quick response
    and for the tips “rankmath.php” verry usefull !

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘Robots.txt custom field’ is closed to new replies.