src/web/app/mu-plugins/disallow-indexing.php
author ymh <ymh.work@gmail.com>
Mon, 09 Dec 2019 11:32:04 +0100
changeset 7 81d22971b333
parent 3 5301eb6ce6e2
permissions -rw-r--r--
adding missing wp-config file

<?php
/*
Plugin Name:  Disallow Indexing
Plugin URI:   https://roots.io/bedrock/
Description:  Disallow indexing of your site on non-production environments.
Version:      1.0.0
Author:       Roots
Author URI:   https://roots.io/
License:      MIT License
*/

if (defined('WP_ENV') && WP_ENV !== 'production' && !is_admin()) {
    add_action('pre_option_blog_public', '__return_zero');
}