• Resolved wwdboer

    (@wwdboer)


    I am encountering a very strange issue where get_option( ‘blog_public’ ) always returns 0. This causes WordPress to always add noindex,follow to the head.

    I have checked the database entry in wp_options and wp-admin/options.php, even when ‘blog_public’ says 1 the get_option function still returns 0. The strange thing is, the checkbox for “Discourage search engines from indexing this site” displays the correct value (1 for unchecked en 0 for check).

    A quick fix for the noindex problem is this remove_action( ‘wp_head’, ‘noindex’, 1 ), but does anyone have any idea why this is happening? I have no plugins installed, just using the default theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Wp uses a virtual robots.txt file, and requires that you NOT have a physical robots.txt file for it to work correctly…..so have you created a robots.txt file in your folder where WP is installed (the same folder where your wp-config.php file is)? That *could* result in this problem.

    If you do and it’s because you need to keep robots out of specific non-WP related folders, just create a robots.txt file INSIDE of those folders.

    Thread Starter wwdboer

    (@wwdboer)

    Thanks for your answer. There is no robots.txt file in that folder, or in any folder.

    Thread Starter wwdboer

    (@wwdboer)

    Found the answer. It was caused by a plugin in mu-plugins folder…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get_option( 'blog_public' ) always returns 0’ is closed to new replies.