Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmcclintock/8330191 to your computer and use it in GitHub Desktop.
Save dmcclintock/8330191 to your computer and use it in GitHub Desktop.
For the forgetful ones of you, such as myself, this little snippet will provide a constant reminder of the status of the "Discourage Search Engines from indexing this site" option in the WordPress settings.
<?php
/* ==========================================================================
A courtesy reminder that "discourage SE from indexing" is still checked
Place in your WordPress theme "functions.php" file or add as a plugin.
by Daniel McClintock (1/9/2014 @ 0100)
========================================================================== */
function seo_checker() {
$robotscheck = get_option( 'blog_public' );
if ($robotscheck == 0 && is_admin() ) :
echo '<span style="width:160px; text-align: center; background-color:#B32525; padding:10px 0; color:white; position:fixed; bottom:0; left:0; border-top: 4px solid #DE4C42; z-index: 15000;">Search Engines Discouraged</span>';
else :
echo '<span style="width:160px; text-align: center; background-color:#6CA06C; padding:10px 0; color:white; position:fixed; bottom:0; left:0; border-top: 4px solid #6EDE42; z-index: 15000;">Search Engines Allowed</span>';
endif;
}
add_filter('admin_footer_text', 'seo_checker');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment