17 pointsStarting to get into this DEV thingI'm new here
Zyniker
Member
—
8th July 2010
How would one go about 'hiding' some blogs from the blogs directory? There are certain blogs on my site that I would prefer not to have included in the directory.
How would one go about 'hiding' some blogs from the blogs directory? There are certain blogs on my site that I would prefer not to have included in the directory.
I am aware of the fact that it automatically follows the general Privacy settings for the blog; however, there are some blogs that I would like not to 'hide' from search engines, but, also, not include in the directory. Not sure if this is possible with the current state of this plugins code.
You'll need to edit the query on line 251. After looking at the code just now it seems I forgot to exclude private blogs. You can replace line 251 with the following to fix that:
$query = "SELECT * FROM " . $wpdb->base_prefix . "blogs WHERE public = 1 AND spam != 1 AND deleted != 1 AND blog_id != 1";
Responses (7)
Lifetime member! — 8th July 2010 #
I think this is automatic with the privacy of the blog.
go in settings/privacy in your dashboard. :)
Member — 8th July 2010 #
I am aware of the fact that it automatically follows the general Privacy settings for the blog; however, there are some blogs that I would like not to 'hide' from search engines, but, also, not include in the directory. Not sure if this is possible with the current state of this plugins code.
Member — 8th July 2010 #
I just checked my settings and the plugin is not respecting the Privacy settings on individual blogs.
Lead Developer — 8th July 2010 #
It may be cached.
As far as choosing only certain blogs, you will have to add that code to the blogs directory plugin.
Member — 8th July 2010 #
I cleared my cache and the problem persists. Any tips on where to begin editing the code if I want to exclude a certain list of blogs?
Erstwhile founder — 8th July 2010 #
You'll need to edit the query on line 251. After looking at the code just now it seems I forgot to exclude private blogs. You can replace line 251 with the following to fix that:
$query = "SELECT * FROM " . $wpdb->base_prefix . "blogs WHERE public = 1 AND spam != 1 AND deleted != 1 AND blog_id != 1";
Member — 8th July 2010 #
Thanks for the code, Andrew. That fixed it.
Become a member