no index

#183479
  • Resolved Ivana Lovric
    Rank Math free

    Hello,

    I have a coupon Website and I realized that my Coupon Sites are not indexed, even though in the global settings of the coupons it is set to index. When I open a single coupon in the settings of Rankmath it is set to no index. I have too many coupons to index each one of them. I checked my .htaccess and robots.txt and everything is fine there.
    Can you please give some Feedback about this issue?

    Best regards,

    Ivana

Viewing 3 replies - 1 through 3 (of 3 total)
  • Prabhat
    Rank Math agency

    Hello,

    Thanks for contacting us and we regret the inconvenience caused.

    Unfortunately, we do not have a feature to change bulk index noindexed posts. Even though you can toggle the index from the Rank Math > Titles & Meta page, these settings will only take effect when creating new posts.

    To work around this, you can make use of a filter to set all the posts on the post type to index like so:

    /**
     * Allows filtering of the robots meta data.
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
         global $post;
         // filter for only a specific post type
         if(get_post_type() == "your_post_type_name_here"){
            $robots['index'] = "index";
            return $robots;
         }
    	return $robots;
    });

    Please make sure to replace “your_post_type_name_here” with the actual post type name.

    Let us know how that goes.

    Thanks.

    Hello again,

    It didn’t help me, I added this code to my functions.php.
    In the end I tried to update the meta_value from rank_math_robots in phpMyadmin and it seems like this solved my issue for now.

    Thank you for your reply and your help.

    Best regards,

    Ivana

    Prabhat
    Rank Math agency

    Hello,

    We’re glad that you got that sorted.

    If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘no index’ is closed to new replies.