• Resolved Ali Hussain

    (@alihs123)


    Looking to block robots on one of our sites in a specific env (staging) via PHP. Is that doable, i couldnt find anything in the dev docs.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support devnihil

    (@devnihil)

    @alihs123 You can set the robots meta tag to a value of noindex using the X-Robots tag. For example, if you want to prevent search engines from showing files you’ve generated with PHP, you could add the following in the head of the header.php file:

    header("X-Robots-Tag: noindex", true);

    We have additional information on using the X-Robots-Tag here: https://yoast.com/x-robots-tag-play/

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    This thread has been marked as resolved due to lack of activity by original poster.

    If you are not the original poster but have a similar issue, please open a new request.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable indexing via PHP’ is closed to new replies.