Set NoIndex for Posts with a Specific Tag or Category

#9034
  • Resolved Justin Gesso
    Rank Math pro

    Hello, we have the need to set Posts with a specific Tag to NoIndex.

    Said another way, we don’t want all Posts to be NoIndex. We also don’t necessarily want the Category or Tag page itself to be NoIndex. We just want the ability to set a subset of Posts to NoIndex based on a Tag (e.g. all Posts with X Tag are NoIndex).

    Is this possible to do?

    And I know I can manually set individual Posts to NoIndex but these Posts are created programmatically.

    Thanks! We are really appreciative of the tool.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I can suggest that you create some code to modify the frontend robots meta only for certain categories by making use of the following filter:

    /**
     * Allows filtering of the robots meta data.
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    	return $robots;
    });

    I hope this info helps. Thank you.

    ​​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Set NoIndex for Posts with a Specific Tag or Category’ is closed to new replies.