Expert Not Showing Up In Search Results

Hi,

I manually created an expert on the backend, as a test. It seemed to show up fine on the website.

I changed the protection rules -- I want everyone to be able to see that there are experts if they are on the Browse Experts page, but I only want certain member levels to be able to access the expert’s profile when they click on it. After I changed the protection rules, I seemed to be able to achieve this.

A little later, I went back to the website, and the expert was no longer showing up. I’ve since manually added a couple more experts, but they don’t show up either – not on the Browse Experts page, not on the Landing Page shortcode. I’m not sure what I did to cause this. :slight_frown:

I am, however, able to access the expert’s page (expert/name-name/) if I type in the URL directly. It just doesn’t seem to show up when you search for it.

Thanks in advance for your help!!!

Kind Regards,
Julie

  • Adam Czajczyk

    Hey Julie,

    I hope you're well today and thank you for your question!

    I've visited your site and checked its settings. I've also tested some settings changes and different memberships but with no success. At the moment the "coach listing" page isn't protected at all so it should display the coach list to everyone.

    I tried to replicate it on my test setup but it works for me as expected. However I'd like to ask you to run some more simple test and let me know of the results:

    1. Disable the Ultimate Branding "Text change" module for a moment and check for the issue
    2. If it doesn't help, would you please run a plugin conflict test by disabling all the plugins at once (excluding Jobs & Experts of course) and then enabling them one-by-one each time checking for the issue?

    Let me know please how it went!

    Cheers,
    Adam

  • Adam Czajczyk

    Hey Julie,

    I hope you're well today!

    It seems it's all working now so you should be safe to protect the page again with Membership's protection rules. It turned out that there was nothing wrong with your setup. Actually, re-saving one of the "Coaches" helped. It's weird but it leads me to thinking of one of the likely reasons:

    1. Something unexpected (and rather difficult to identify now) went wrong before and broke the data in the database

    2. There's some kind of cache on a server side. I've found out that you're using Inmotion's VPS so I think you could take a look around your server's management panel (or eventually ask their tech staff) if there's indeed any caching enabled.

    That said, please test if everything's all right now (just to make sure)!

    Cheers,
    Adam

  • Julie

    Hey Adam,

    Thanks so much for your help!

    The coaches (experts) did show up on the Browse Experts page earlier this morning, but are not showing up now. (This happened to me as well as a colleague of mine, using different computers/browsers.) The only change I made during that in between time was changing the "in this text domain" field on part of the Network Wide Text Change section of Ultimate Branding.

    Both earlier and now, the experts did not show up through the Landing Page shortcode, which I have on the following pages:

    /gymnastics-instructor-jobs/
    /gymnastics-coaches-needed/

    Also, I checked, and per the tech staff at Inmotion there is no server side caching enabled on the server at this time.

    Thanks again for all of your help, Adam! Please advise.

    Kind regards,
    Julie

  • Adam Czajczyk

    Hey Julie,

    This is mostly unfortunate :slight_frown:

    I took another look at your site and this time re-saving a coach didn't help. Then I've installed a "Query Monitor" plugin to check all the DB queries, HTTP requests etc and found out that there's a broken JS dependency, pointing to an "Advanced textarea" add-on. I've switched it off, re-saved random coach again and the listing of coaches was back.

    However, after first change I made to the site via Upfront (looking for glitch in shortcodes) it stopped working again. I've compared this with my own test setup and also followed everything I did on your site step by step but couldn't replicate it.

    That being said, I'm calling our 2nd-line support team for help here. I hope after they take a look at this they'll be able to identify the culprit here.

    I've also checked these two pages you mentioned in your recent post and I've found that the shortcode was setup to show Jobs instead of Coaches (on "coaches needed" site) but although I've changed it, it didn't work also (I brought back original shortcode already). I'm pretty sure this is related directly to the main issue.

    Please keep an eye on this thread for further updates and information and it would be great if you could keep the support access open (it's valid for 72 hours but you may extend it any time).

    Kind regards,
    Adam

  • Predrag Dubajic

    Hi Julie,

    On your instructor page ( /gymnastics-coaches-for-hire/ ) the experts are still visible, and on your coaches page ( /gymnastics-instructor-jobs/ ) I can see that the recent coaches are not showing.
    However, if you use this shortcode [jbp-expert-archive-page] on your coaches page it worked normally when I tested your site.

    Will this solution work for you?

    Best regards,
    Predrag

  • Julie

    Hi Predrag,

    The experts were visible when I first read your post. However, I then added another expert as a test, and now they are not visible.

    It's been my experience so far that whenever the experts are showing, another change on the site (such as adding another expert) causes the experts to stop showing up.

    Also, when I added the shortcode to the coaches page, the recent coaches were still not showing. The shortcode just added a search box on the page; but in using the search box, I could not get any coaches to show up as a result.

    Please let me know what else I can try. I appreciate your help!

    Kind regards,
    Julie

  • Hoang Ngo

    Hi @Julie,

    I hope you are well today.

    When you added an experts, in the admin pages, do all the experts still showing up without any issue? In addition, I would like to access to your FTP for checking too. Can you please send in:

    - Mark to my attention - ATTN: Hoang Ngo
    - Link back to this thread
    - Include admin/network access
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks!!.

    Best regards,
    Hoang

  • Julie

    Hi @Hoang Ngo,

    I sent in the requested information using the contact form. Please let me know if you need any additional information.

    It seems to me that whenever another expert is added (or possibly any change is made through Upfront), the experts stop showing up on the front end. They still show up on the back end.

    Thank you so much for your help. I definitely appreciate it!

    Best regards,
    Julie

  • Adam Czajczyk

    Hey Julie,

    I hope you're well today!

    I've visited your dashboard once again and took a look at the page in question.

    It seems that the /gymnastics-coaches-for-hire page is respecting Membership 2 Protection Rules as it should. I've entered Membership 2 "Test Membership" mode (a link in your admin toolbar) and depending on membership chosen I was able to view the listing or not (though there's no "protected content" message). I've also added another coach and make an example change (reverted already) via Upfront editor - still working fine.

    As for /gymnastics-instructor-jobs/ page.

    The "Recent Coaches" seems to be working just fine as well. The only "glitch" I can see there is that there's a bunch of shortcodes displayed n front-end (see screenshot). This is however because one of the jobs created (see "Jobs" -> "Manage Jobs" -> Gymnastics Coaching Jobs) includes the "Jobs & Experts" shortcodes.

    That being said, my tests indicate that it's all fine now but if I'm missing anything here, please let me know and it would be great if you could in such case once again outline the "step-by-step" procedure to reproduce the issue.

    Have a nice day!
    Adam

  • Julie

    Hi Adam,

    I’m doing well, thanks! Hope you’re well today!

    Thank you so much for your help & patience. I really appreciate both! :slight_smile:

    As I mentioned in the original post, I want everyone to be able to see that there are experts if they are on the Browse Experts page, but I only want certain member levels (gold/silver/bronze) to be able to access the expert’s profile when they click on it.

    I see that this is happening with the gold/silver/bronze levels (yay!).

    However, for the other member level (coach) and for a non-registered user, they cannot see any experts on the Browse Experts page (please see attached screenshot).

    So I’m thinking at this point it’s a problem with the way I’ve set up the Protection Rules and no longer has anything to do with any possible glitches(?).

    How do I need to have the Protection Rules set up to allow everyone to see that there are experts if they are on the Browse Experts page (/gymnastics-coaches-for-hire/), but only gold/silver/bronze member levels to see the actual expert profiles?

    I think this is somewhat related to another question I posted yesterday:

    https://premium.wpmudev.org/forums/topic/experts-viewing-their-own-profile-with-membership-2-pro

    If one of those threads needs to be closed, please let me know or if you could close it for me – I don’t want to have duplicate questions out there.

    Again, I appreciate all that you have done! Thank you SO much!!!

    Best regards,
    Julie

  • Predrag Dubajic

    Hi Julie,

    Custom post type protection will hide post (in this case expert) preview as well, this is how the plugin is designed to work, there is a workaround for this by enabling URL protection add-on in M2 and protecting each expert url.
    This way the expert preview is shown but actual single expert page is not if you don't have correct membership.

    However URL protection is not working on your site for some reason as I already tried setting it up for you to show you how it works.
    Could you try disabling your other plugins and see if URL protection would work after that because I was unable to replicate this issue on my installation with M2, J&E and Spirit theme running.

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Julie,

    Apologies I was unclear about this in my previous comment.

    I have enabled URL Protection Add-on and now when you go to Membership 2 > Protection Rules you will see URL Protection tab, where I protected new page /wpmu-test/ page.

    You now shouldn't be able to see that page while logged out, but for some reason it's not working.
    So can you try disabling your other plugins and check if you can access that page after that, while logged out of course?

    Hope this clears things up :slight_smile:

    Best regards,
    Predrag

  • Julie

    Hi Predrag,

    I just need a little more explanation sometimes. :slight_smile: Thanks so much for your post -- it definitely helped!

    I disabled all plugins (except for Membership 2 Pro), but I could still access the page. I also switched to a different theme, but I could still access the page. This was all while logged out.

    Please let me know what else I should do. Thank you again for all of your help!!!

    Best regards,
    Julie

  • Adam Czajczyk

    Hey Julie,

    I hope you're having a nice day!

    I took a liberty of accessing your dashboard once again and I followed the way that my colleague @Predrag Dubajic started. For some reason this indeed doesn't work as described/expected but it is actually working. The solution here is to use only a "slug" part of an URL to protect.

    Take a look please at your dashboard's

    "Membership 2" -> "Protection Rules" -> "URL Restrictions" page

    Instead of using an entire URL of the page to be protected I've used just the "/wpmu-test/" part. I tested it both using "Test membership" feature and as not-logged in user from different browser and it's working this way.

    That being said, now you should be able to proceed with Predrag's advise from this post:
    https://premium.wpmudev.org/forums/topic/expert-not-showing-up-in-search-results#post-928580

    Just to sum it up: to let all users see experts listing keep the "Browse Experts" page "open" (available for everybody) and then "/expert/" string to "URL Restrictions" rule. This way everybody should be able to access /gymnastics-coaches-for-hire/ page and see coaches listing. Only users with proper membership though should be able to see the content of page of single coach.

    I hope that helps!

    Cheers,
    Adam

  • Julie

    Hey Adam,

    Thank you for all of your help!

    I think I've set it up the way you described in the summary: the "Browse Experts" page is unprotected (available for everybody) and "/expert/" has been added as a Page URL for URL Restrictions.

    The "/expert/" restriction seems to work as expected – only users with proper membership are able to see the content of page of single coach.

    However, with this set up, not everybody can see the coaches listing on the /gymnastics-coaches-for-hire/ page. Please see the attached screenshots from when I tested this on the admin side. This was the same when I tried it in a different browser - signing in as a gym membership level would show the coaches listing, but signing in as a different membership level (or not signing in) did not show the coaches listing.

    If I am missing something (and hopefully I am!) please let me know. Otherwise please advise what I should try so that everyone can see the coaches listing on the /gymnastics-coaches-for-hire/ page.

    Thanks again for all of your assistance.

    Best regards,
    Julie

  • Hoang Ngo

    Hi @Julie,

    I hope you are well today.

    Because the custom post type jbp_pro protection has been enabled, so the result is any queries to that post type will not be public. For summarise, the things we need to archive are
    1. All user can access to the page /gymnastics-coaches-for-hire/ and see every contents
    2. When user click on the expert/coach link, this when the protection happening.

    I've took a look to your settings. For now, we only need to remove the Custom Post Type protection and it will be working. Please check my screencast for the test :slight_smile: The loading will be a little bit slow :p

    https://www.dropbox.com/s/7d6830y82rgwa9z/job-experts.webm?dl=0

    If you have any additional issues, please let us know and we'll be happy to help.

    Best regards,
    Hoang

  • Julie

    Hi @Hoang Ngo,

    Thank you for all of your help!!! Also, thank you for the screencast for the test. :slight_smile:

    I see how it works as expected for non-members and for Gold/Silver/Bronze level members. :slight_smile:

    However, for Coach level members that I'm testing on the front end, when the user clicks on the expert/coach link, there is not the Protected Content message (which we want) like there is in the screencast for non-members. It just directs back to the home page. For Coach level member test on the back end, I can still see the expert (please see attached screenshot).

    I may have missed something here -- if so, please let me know!!!

    Thank you again for all of your help!

    Best regards,
    Julie

  • Hoang Ngo

    Hi @Julie,

    That's because we allowed 4 memberships can access to that page: Bronze, Silver,Coach,Gold. I removed the Coach in the Membership2->Protection Rules->URL Restrictions.

    For now, the site will work like this
    1. On the /gymnastics-coaches-for-hire/ page, every one can see every coaches/experts
    2. Only Bronze, Silver & Gold membership can see the coach detail. The other will se protection page.

    If you have any additional issues, please let us know and we'll be happy to help.

    Best regards,
    Hoang

  • Julie

    Hi @Hoang Ngo,

    Thank you!!! #1 and #2 as you described seem to be working great!

    Now the only profile protection issue (I think) that remains is that I would like a coach (with the free coach membership) to be able to see her/his own coach profile (but not the other coaches' profiles). I had actually started another thread for that:

    https://premium.wpmudev.org/forums/topic/experts-viewing-their-own-profile-with-membership-2-pro

    Not sure if I should have split up the issues or not - I apologize if I should have kept it all in one thread.

    Anyway, thank you again for all of your help. I greatly appreciate it!!!!!

    Best regards,
    Julie

  • Julie

    Hi @Hoang Ngo,

    I was told in another thread (https://premium.wpmudev.org/forums/topic/experts-viewing-their-own-profile-with-membership-2-pro#post-931970) that I have to add Coach access in the Membership2->Protection Rules->URL Restrictions for the "/expert/" string. However, per our discussions here, there should NOT be Coach access.

    Would you be able to tell me how I can set up my site so that:

    1. On the /gymnastics-coaches-for-hire/ page, every one can see every coaches/experts
    2. Only Bronze, Silver & Gold membership can see the coach detail. The other will see the protection page with one exception (see #3)
    3. Coaches can see their own coach detail

    Otherwise coaches will not be able to view the profile they just created.

    Thanks so much for your help. I look forward to your response! :slight_smile:

    Best regards,
    Julie

  • Hoang Ngo

    Hi Julie,

    We are very close, the only issue now is number #3, coaches should can see their own profile, but not the other.

    For the last, can you please try this code. Please add this code to your theme functions.php or use mu-plugins

    add_filter( 'ms_rule_url_model_excluded_urls', 'ms_rule_url_model_excluded_urls' );
    function ms_rule_url_model_excluded_urls( $excludes ) {
    	if ( is_user_logged_in() ) {
    		//find expert url
    		$models = JE_Expert_Model::model()->find_by_attributes( array(
    			'user_id' => get_current_user_id()
    		) );
    		if ( is_array( $models ) ) {
    			foreach ( $models as $model ) {
    				$excludes[] = get_permalink( $model->id );
    			}
    		}
    	}
    
    	return $excludes;
    }

    Lets see if it works for you :slight_smile:

    Best regards,
    Hoang

  • Hoang Ngo

    Hi there,

    I've just updated the code to

    add_filter( 'ms_rule_url_model_excluded_urls', 'ms_rule_url_model_excluded_urls' );
    function ms_rule_url_model_excluded_urls( $excludes ) {
    	if ( is_user_logged_in() ) {
    		//find expert url
    		$models = JE_Expert_Model::model()->find_by_attributes( array(
    			'user_id' => get_current_user_id()
    		) );
    
    		if ( is_array( $models ) ) {
    			foreach ( $models as $model ) {
    				$excludes[] = str_replace(site_url(),"",get_permalink( $model->id ));
    			}
    		}
    	}
    
    	return $excludes;
    }

    It should works now :slight_smile:

    Best regards,
    Hoang

  • Julie

    Hi,

    Awesome!!! This is fantastic!!!

    The list of 3 things has all been satisfied - doesn't look like there are any other issues there. :slight_smile:

    I did notice that the 2 most recent expert profiles, created on the front end, do not seem to be showing up on the Browse Coaches page (/gymnastics-coaches-for-hire/), even though they do show up when the username is typed into the search bar. Is that normal?

    Thank you again for your amazing help!

    Best regards,
    Julie

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.