Search Results for 'Hide Admin'
-
AuthorSearch Results
-
December 9, 2015 at 6:39 am #247573
Topic: Hide ‘Members’ page from all except Admin
in forum How-to & TroubleshootingsincewelastspokeParticipantHow do I hide my ‘Members’ page from all except Admin?
December 5, 2015 at 8:20 am #247432In reply to: hide bp toolbar
dwsowashParticipantThis in you function php hides it from everyone but admins
//Removes BuddyBar from non-admins only function splen_remove_admin_bar() { if( !is_super_admin() ) add_filter( 'show_admin_bar', '__return_false' ); } add_action('wp', 'splen_remove_admin_bar');
Is that what you mean?
November 10, 2015 at 9:59 am #246529In reply to: hiding groups and forums from members page
danbpParticipantTry
function bpfr_hide_tabs() { global $bp; /** * class_exists() & bp_is_active are recommanded to avoid problems during updates * or when Component is deactivated */ if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) : if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) { bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_subnav_item( 'activity', 'groups' ); } endif; } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
November 10, 2015 at 9:58 am #246528In reply to: Want to add new tab in buddypress profile page.
danbpParticipanttry this:
function bpfr_hide_tabs() { global $bp; /** * class_exists() & bp_is_active are recommanded to avoid problems during updates * or when Component is deactivated */ if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) : if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) { bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_subnav_item( 'activity', 'groups' ); } endif; } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
October 28, 2015 at 2:48 pm #246094In reply to: Hide All Admins from All Buddypress Activities
spluffordParticipantHi, struggling to get any of the the code in post #190874 to work. I have created a bp-custom.php file which I have uploaded to the root of the buddpress folder and my code looks like this:
<?php // deny access to admins profile. User is redirected to the homepage function bpfr_hide_admins_profile() { global $bp; if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) : wp_redirect( home_url() ); exit; endif; } add_action( 'wp', 'bpfr_hide_admins_profile', 1 ); // Remove admin from the member directory function bpdev_exclude_users($qs=false,$object=false){ $excluded_user='1'; // Id's to remove, separated by comma if($object != 'members' && $object != 'friends')// hide admin to members & friends return $qs; $args=wp_parse_args($qs); if(!empty($args['user_id'])) return $qs; if(!empty($args['exclude'])) $args['exclude'] = $args['exclude'].','.$excluded_user; else $args['exclude'] = $excluded_user; $qs = build_query($args); return $qs; } add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); // once admin is removed, we must recount the members ! function bpfr_hide_get_total_filter($count){ return $count-1; } add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter'); // hide admin's activities from all activity feeds function bpfr_hide_admin_activity( $a, $activities ) { // ... but allow admin to see his activities! if ( is_site_admin() ) return $activities; foreach ( $activities->activities as $key => $activity ) { // ID's to exclude, separated by commas. ID 1 is always the superadmin if ( $activity->user_id == 1 ) { unset( $activities->activities[$key] ); $activities->activity_count = $activities->activity_count-1; $activities->total_activity_count = $activities->total_activity_count-1; $activities->pag_num = $activities->pag_num -1; } } // Renumber the array keys to account for missing items $activities_new = array_values( $activities->activities ); $activities->activities = $activities_new; return $activities; } add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 ); ?>
Not sure what I am doing wrong. All help gratefully received! Thanks
October 27, 2015 at 1:49 am #246041In reply to: How to hide administrators from list members
mrjarbenneParticipantYou could try this: https://github.com/r-a-y/bp-hide-user
I don’t use it to hide admin members, but to hide users who are members of a subsite on multisite who I don’t want seen in the main activity feed. If it doesn’t do exactly what you want, I’m sure it’s a great start.
October 26, 2015 at 7:40 pm #246031In reply to: How to hide administrators from list members
pnetParticipantI have been searching for the same, hide admins from GROUP members list.
It seems all the forums point to https://buddypress.org/support/topic/hide-admin-from-members-and-activity/Which the second block of code does not work, for me anyway, breaks my site.
So how do I hide the admins from GROUP members list, not all members list, I have those hidden.
October 18, 2015 at 7:02 pm #245646In reply to: Making Myself An Admin On Buddypress
VenutiusModeratorOctober 12, 2015 at 9:42 am #245361In reply to: Hide All Admins from All Buddypress Activities
Henry WrightModeratorIn post #190874 on the topic you’ve linked to, snippet 2 has the line:
$excluded_user='1'; // Id's to remove, separated by comma
You can just add more user IDs like this and those IDs will be excluded from the loop:
$excluded_user='1,34,56,201'; // Id's to remove, separated by comma
September 26, 2015 at 2:07 pm #244817In reply to: Restricting Group Deletion to Super Admin
danbpParticipantHi,
simply remove the delete group button from group admin. Give this a try, only site admin will see the button. Add snippet to bp-custom.php
function kwahlquist_remove_group_admin_tab() { global $bp; if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) { return; } // Add the admin subnav slug you want to hide in the following array // other admin subnav items are: group-settings, group-avatar, group-invites, manage-members $hide_tabs = array( 'delete-group' => 1 ); // since BP 2.2 $slug = bp_get_current_group_slug() . '_manage'; // Remove the nav item foreach ( array_keys( $hide_tabs ) as $tab ) { bp_core_remove_subnav_item( $slug, $tab ); } } add_action( 'bp_groups_setup_nav', 'kwahlquist_remove_group_admin_tab', 9 );
September 10, 2015 at 8:28 pm #244254In reply to: Hide Buddypress pages from google serch.
djstevebParticipant@nithin270 – any changes you make for search spiders is going to take weeks (at minimum) before they are reflected in the search results.
I suggest doing some robots.txt additions (will list mine below) – however realize that long ago google made a decisions that even if your robots.txt says to disallow crawling something, if another page on the web links to your subpage that is blocked by robots.txt, it will still show the url in the search results – but have a description something like “this sites robots.txt prevents google from displaying description of this result”.
There has been debate about that decision, but it is what it is.
The only way to really prevent a page showing up in results is to hide it behind a password (like htpasswd) – however google does normally remove results if that page (or header info of images) includes “noindex” in the head of the page (there is a tricky way to add this to images – it was pointed out to me in the google webmaster forums)
given that bp pages like members are kind of pseudo pages, using something like yoast (currently as far as I know) – will not give you an option to add noindex, nofollow to your member pages..
you may be able to modify the code I got from wpmudev that checks “if is member page, then add meta description as…” –
( http://premium.wpmudev.org/forums/topic/bp-meta-tite-description-for-groups-and-members-pages#post-806736 )
to… also check “if is members page” – then add “meta name=”robots” content “noindex, nofollow”..
(something like that)that should remove your members pages next time google crawls your site and the crawlers send the info back to the main algo/index..
I think there is a way to log into google webmaster tools if you have claimed /verified your site and click on urls to ask the big G to remove them as well. (I have not messed with that stuff in a while )
I also suggest adding a robots.txt file similar to this:
Disallow: */activity/p/*
Disallow: /docs/
Disallow: *send-invites*
Disallow: */groups/*members*
Disallow: */groups/*media*
Disallow: *widget-title*
Disallow: *members/*activity*
Disallow: *members/*notifications*
Disallow: *members/*friends*
Disallow: *members/*groups*
Disallow: *members/*docs*
Disallow: *members/*media*
Disallow: *acpage*
Disallow: *messages*
Disallow: *friends*
Disallow: *settings*
Disallow: /*/comment-page*
Disallow: *register*
Disallow: *login*
Disallow: *profile*
Disallow: *admin*
Disallow: *includes*
Disallow: *content*to prevent some other quirky indexing issues with bp.
If your member profile stuff is sacred, then I would hunt the forums here for what others have been messing with that prevents profile info from being displayed if a user is not logged in… as there are plenty of indexing spiders that will not follow the robots.txt or robots index rules in <head> – in fact some specifically look for these things and purposely crawl and scrape stuff that is blocked –
Disclaimer: I am not an expert, not a real coder. Research these things with other sources, your situation may vary.
September 10, 2015 at 12:48 am #244207danbpParticipanthi,
first snipppet removes the mention tab.
Second remove the mention item from the top right usermenu below howdy.Condition is set to site admin. If you use custom capabilities, change that to your need.
Code goes to bp-custom.phpfunction bpfr_hide_mention_nav() { //if ( bp_current_user_can( 'bp_moderate' ) ) if ( is_super_admin() ) { return; } bp_core_remove_subnav_item( 'activity', 'mentions' ); } add_action( 'bp_ready', 'bpfr_hide_mention_nav' ); function bpfr_admin_bar_remove_activity_mentions(){ global $wp_admin_bar; if ( is_super_admin() ) { return; } $wp_admin_bar->remove_node('my-account-activity-mentions'); } add_action('wp_before_admin_bar_render','bpfr_admin_bar_remove_activity_mentions');
An alternate (IMO better) solution, is this premium plugin: http://www.philopress.com/products/buddynotes/
August 19, 2015 at 11:26 am #243376danbpParticipantBuddyPress use bbPress when you allow group forums.
If the group is private, the attached forum is also hidden ton non members of that group. Same for public or private groups.You don’t have to change the group forum setting in the forum list.
The right steps
Create a group A
A is set to private
Allow a forum for A
—— The wrong step ——–
Going to dashboard forum admin, and set forum A to private. If you do this nobody will see it except site admin.
https://buddypress.org/support/topic/hide-buddypress-and-bbpress-items-from-guests/
https://buddypress.org/support/topic/buddypress-private-group-is-not-visible-in-bbpress/August 13, 2015 at 10:35 am #243126atfpodcastParticipantDeactivate and delete the admin bar plugin. Remove also any custom code you have added in the past concerning the toolbar. The idea is to revert back to a fully standard WP install.
It was already deactivated. I wonder if it left anything altered? that other snip it i added to try does not exist.
If this doesn’t work, you have to go to your db and check the wp_options table for the toolbar setting.
Search for option_name hide-loggedout-adminbar where value must contain 1.im using godaddy so i guess that would be in myphpadmin?
August 13, 2015 at 8:51 am #243116danbpParticipantI can confirm that Raindrops theme is working correctly with BP and taht the admin bar is showing up to logged in users.
Deactivate and delete the admin bar plugin. Remove also any custom code you have added in the past concerning the toolbar. The idea is to revert back to a fully standard WP install.
If this doesn’t work, you have to go to your db and check the wp_options table for the toolbar setting.
Search for option_namehide-loggedout-adminbar
where value must contain1
.August 13, 2015 at 6:59 am #243109atfpodcastParticipantYes sir the bar is there when are not logged on. I added show_admin_bar( true ); in a function plugin and that did not work. I tried the 2014 theme with the same results. no tool bar. THe one i deactivated was the one from stranger studios hid admin bar to non admins and and I deactivated that.
https://wordpress.org/plugins/hide-admin-bar-from-non-admins/July 12, 2015 at 1:46 am #241758djstevebParticipant@dangthrimble – no matter what you do to hide the admin username, the really good hack teams are running scans to get the admin names by running url checks like “yourdotcom /?author=2
?author=3and scraping the details wp is providing both on page, and in meta fields.
Then adding those names to their pass cracking bot nets.
(look in your raw access logs, you will see it)I’ve tried changing names on wp sites many times, the rssn hackers get getting the new names, you can tell if you check your fail log with “limit login attempts” plugin.
I’ve played with some code to change in wp themes to hide details there, but my php is slightly below beginner and my understanding of what the theme code is doing is same.
I tried a plugin from the wp-repo that is supposed to hide all that- but it’s not working.
(you could htaccess geo block ukrain and chna from your site completely and probably prevent 90% of these issues anyway from what I have seen by checking logs)
I found some htaccess someone posted that is supposed to suppress all requests for “/?auth [nc] or something like that – but since I do not understand what each part is doing, I have not deployed it.
I think it needs to be htaccess add and include anything with “author” and a number to work well (reg ex for numbers?)
Until I find a htaccess regex method I understand and trust, I have found that the best combo for prevention is:
Geo IP Block
(https://wordpress.org/plugins/ip-geo-block/ )
(default settings are okay, I think it’s best to change the drop downs to block by country the plugins area, theme area, admin ajax, etc as well – options in settings
Also some blogs may want to uncheck the “comment post” block by country
)If this geoip block plugin author had a donate link I’d already sent him some bucks, it’s the most useful plugin I’ve found since… “good question”
and succuri is an informative add on as well
(shows that some bots have figured out how to bypass the limit login attempts max tries setting)The way WP is handling question marks in urls (string queries I think it’s called) and giving up 200 status codes and extra info (including author names) to bots is a big issue for me, this kind of relates to the unanswered support question I posted here:
https://wordpress.org/support/topic/question-mark-url-return-200-not-404-string-query-noindex-or?replies=1July 11, 2015 at 8:09 pm #241747shanebpModeratorGoogle: buddypress hide admin from members list
July 11, 2015 at 3:22 pm #241734shanebpModeratorI would like to be able to hide all the information about my site administrators
What do you mean by ‘hide’?
Make them invisible?If you’ve changed the name of the admin’s account so it doesn’t say ‘admin’, then why do you need to hide it?
How would a scraper know that it’s the admin’s account?June 28, 2015 at 5:23 am #241200In reply to: Action Hook for bp-registration
Gnostic_ThoughtParticipantI am not sure. I bought a plugin from codecanyon and am trying to alter it to work with buddypress. I think this is the code I will have to alter
public function __construct() { $this -> admin = WP_Atr_Admin :: get_instance(); # registration hooks: add_action( 'login_enqueue_scripts', array( $this, 'initialize_registration' ) ); add_action( 'register_form', array( $this, 'add_checkboxes_to_registration' ) ); add_filter( 'registration_errors', array( $this, 'validate_registration' ), 10, 3 ); # mu add_action( 'signup_header', array( $this, 'initialize_registration' ) ); add_filter( 'wpmu_validate_user_signup', array( $this, 'mu_validate_registration' ), 10, 3 ); add_action( 'signup_extra_fields', array( $this, 'mu_add_checkboxes_to_registration' ) ); # add button add_filter( 'the_content', array( $this, 'add_button_to_pages' ) ); $this -> register_page_status(); if( is_multisite() ) { add_filter( 'all_plugins', array( $this, 'hide_plugin_in_mu_sites' ) ); } }
I would figure I would prefix bp_ to some of the code here
# registration hooks:
add_action( ‘bp_login_enqueue_scripts’, array( $this, ‘initialize_registration’ ) );
add_action( ‘bp_register_form’, array( $this, ‘add_checkboxes_to_registration’ ) );
add_filter( ‘bp_registration_errors’, array( $this, ‘validate_registration’ ), 10, 3 );but it like there is more to it than that according to your link.
May 17, 2015 at 10:02 pm #239335In reply to: How to hide admin from group members directory?
May 7, 2015 at 5:05 pm #238788In reply to: Hide members from Member Directory
danbpParticipantAdditionaly you can use/be inspired by this:
https://buddypress.org/support/topic/hide-admins-activities-from-all-activity-feeds-in-buddypress/#post-223433Successfully tested on BP 2.2.3.1 WP 4.2.2 Twenty Twelve
April 26, 2015 at 2:27 am #238363In reply to: Login redirect not excluding admin
danbpParticipantTry
if ( !is_super_admin( $current_user_id))
Or use the WP filter
function hide_my_admin_bar() { // by user role if ( current_user_can( 'manage_settings' ) ) { return true; // Show for admins } else { return false; // Hide for other users } } add_filter( 'show_admin_bar', 'hide_my_admin_bar' );
April 25, 2015 at 11:45 pm #238357In reply to: Login redirect not excluding admin
@mcukParticipantI’ve set up two users to test various things on site during development, one with Administrator and one with Subscriber roles. That’s what the wp dash is confirming under users.
I also have another function to hide the wp admin bar at the top of the page which includes the is_super_admin(). When its active, the admin bar is removed for the subscriber but not the admin user as intended. So can only assume that there is a problem with my redirect function itself or perhaps its clashing with something else (though I have no other plugins atm).
//Remove wordpress admin bar for all except admin function bpmc_remove_admin_bar() { if( !is_super_admin() ) add_filter( 'show_admin_bar', '__return_false' ); } add_action('wp', 'bpmc_remove_admin_bar');
April 3, 2015 at 1:33 pm #237244danbpParticipanthi @mcpeanut,
this snippet useable from BP 2.0.1 and above, can be added to bp-custom.php
it will hide the field ID 1 which is the default Name field to all, except site admin.it will also avoid the user to edit that field. So if you use this, i recommand you tell them on register page that once they entered a name it they could change it later. You can than ask them $$$$ to do it. 😀
function bpfr_hide_profile_field_group( $retval ) { if ( bp_is_active( 'xprofile' ) ) : // hide profile group/field to all except admin if ( !is_super_admin() ) { //exlude fields, separated by comma $retval['exclude_fields'] = '1'; //exlude field groups, separated by comma $retval['exclude_groups'] = '1'; } return $retval; endif; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
More here:
-
AuthorSearch Results