Cannot get rid of 'none' in meta robots

#19073
  • Resolved Steve
    Rank Math free

    I have an urgent issue in that RankMath is adding the line below to every page on my site:

    <meta name=”robots” content=”follow,index,none” />

    I don’t mind the follow, index – but the none is going to kill my SEO. How can I get rid of it? I’ve spent an hour trying everything and it doesn’t appear that I’ve selected any options to enable this. Please help.

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

    This is a rather unusual issue, not sure what could be causing it, but we can offer a quick fix for it that involves a few lines of code. We will try to reproduce the issue on a test site in order to fix it for good.

    For now, you could add the following code to the functions.php file of your child theme:

    /**
     * Rank Math: filter the robots meta data.
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    	unset( $robots['none'] );
    	return $robots;
    });

    The code makes use of a filter hook available in Rank Math, to remove “none” value from the robots meta tag: https://rankmath.com/kb/filters-hooks-api-developer/#change-robots-meta

    Hope that helps. If you have any question, please feel free to ask. Thank you.

    Steve
    Rank Math free

    Yes – that’s perfect. I verified this fix and no longer see the none option. Thanks for the quick response!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do 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 ‘Cannot get rid of 'none' in meta robots’ is closed to new replies.