[wp-hackers] set wordpress privacy from functions.php
Barry Ceelen
barry at multipop.org
Mon Mar 7 18:08:20 UTC 2011
sorry, little typo: didn't use the same function name in the add_action part:
add_action( 'init', 'keep_private' )
On 7 Mar, 2011, at 19:06 , Barry Ceelen wrote:
> The setting you're looking for is 'blog_public'
>
> Public = 1
> Private = 0
>
> So you could do something along these lines this in your functions file or a plugin:
>
> add_action( 'init', 'private' );
>
> function keep_private() {
> update_option( 'blog_public', '0' );
> }
>
>
>
>
>
>
> On 7 Mar, 2011, at 18:52 , Andrew Gray wrote:
>
>> I would like to create a plugin that forces the site to not show up via to search engines. I want to force Site Visibility to be none.
>> I want to change the option via a function and override what is in the database.
>>
>> Does anyone know where that option is stored?
>>
>> My goal is to put this into my development switch to stop search engines from finding out live sites. We too often forget to update the database after we move over production data,
>>
>> thanks,
>>
>> Andrew
>>
>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list