Rank Math Force Noindexing a Customised Page Template

#68523
  • Resolved Andy Butler
    Rank Math pro

    I’m working on a WordPress website for a real estate company. The property detail pages use the pages post type but seem to run off a pretty heavily customised standalone page template. The property details pages are not setup as pages in wordpress as they pull their information from custom tables in the database into the custom temnplate file.

    I’ve just realised that since moving to Rank Math from Yoast, the property detail pages have been using a robots meta tag of ‘follow,noindex’ and not ‘follow,index’ as the normal wordpress pages use.

    As a result all property detail pages have disappeared from Google.

    If I disable the Rank Math plugin the problem fixes itself, but when I re-enable it the problem returns, so it seems that Rank Math is the cause of the problem.

    I have checked and tested every available option in Rank Math but I’m unable to force the custom pages to index. The standard wordpress pages are set to be indexed.

    I found some filter code recommended for a similar type problem:

    /**
    * 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() == “page”){
    $robots[‘index’] = “index”;
    $robots[‘follow’] = “follow”;
    return $robots;
    }
    return $robots;
    });

    This fixed the problem but it then forced pages that have been set to ‘noindex’ to be indexable. So now I have the reverse problem.

    Is there a reason why Math Rank would be forcing a page to noindex and is there a way to override this just for the property detail pages?

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.

    If you imported your settings from Yoast, there should be no reason for Rank math to change the settings. Could you please head to Rank math dashboard > Import/export and check if the option to import from Yoast is still there, if so, click import and let us know how this goes.

    Looking forward to helping 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 ‘Rank Math Force Noindexing a Customised Page Template’ is closed to new replies.