• Resolved gtatar

    (@gtatar)


    I am trying to prevent Yoast from outputting <meta name=’robots’ into my pages because I’d like to handle this on my own.

    I tried add_filter('wpseo_robots', '__return_false'); which produces this:

    <meta name='robots' content='noindex, nofollow' />

    I also tried

    function remove_yoast_robots_meta($old_string) {return '';}
    add_filter('wpseo_robots', 'remove_yoast_robots_meta');

    Which for some reason produces:

    <meta name='robots' content='max-image-preview:large' />

    Neither of this is what I want. I want instead to not have a <meta robots at all (on existing and future pages). Could someone help?

    • This topic was modified 2 years, 4 months ago by gtatar.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support devnihil

    (@devnihil)

    @gtatar In the latest version of Yoast SEO, setting wpseo_robots to false now set the content value to noindex, nofollow.

    Currently there is not a filter available to completely remove the robots meta tag from the Yoast SEO output.

    While we don’t have an immediately available solution to remove the robots meta completely from your website, the robots meta tag should have no effect when there’s no value in the content key. So, you may want to return an empty string i.e., from the wpseo_robots filter to see whether it returns an empty value for you in the robots meta.

    Thread Starter gtatar

    (@gtatar)

    Thank you @devnihil. Any extra robots directive (even with empty content) has the potential to confuse search engines, because the search engines will not know which directive to trust. Moreover, each search engine can have their own rules on selecting between multiple robots directives.

    In previous versions there was a mechanism to disable meta robots. Can we add this ability again (via the old mechanism or a new one)?

    Plugin Support Maybellyne

    (@maybellyne)

    You can create a feature request for this functionality at https://github.com/Yoast/wordpress-seo/issues

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to disable robots meta tag?’ is closed to new replies.