Hide "Blocking robots" nag when site in development
-
I’m very thankful for the “blocking robots” nag when the site is blocking search engines. However, when I’m developing a site, it’s, well…nagging. If I spend two weeks developing a site, I don’t want to see the warning the entire time. But, I do want to see it once I go live.
The thing is, I almost always develop sites on a subdomain, like https://dev.domain.com/. Is there a way to hide the nav when the subdomain is dev?
Here’s what I’ve tried so far, but all it does is gives me a blank admin page.
//* Ignore WordPress SEO "Blocking Robots" nag when site in development add_action( 'admin_footer', 'joe_hide_wpseo_nag_dev' ) function joe_hide_wpseo_nag_dev() { $url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if ( is_admin() && strpos($url,'://dev.') == false ) { remove_action( 'admin_footer', 'blog_public_warning' ); } }
Any ideas?
- The topic ‘Hide "Blocking robots" nag when site in development’ is closed to new replies.