Global search results are not the same for admin and non admin users

I'm having some issues with WP search on a site where I use membership2pro to restrict access. The issue is - when admin uses the global search, results are found and when non-admin searches - no results.
I'm using a plugin called search everything to get non post results - I have tried deactivating this plugin with no success at fixing the issue.

  • Predrag Dubajic

    Hi Morad,

    Thanks for granting access, I had a look at your site and I tested it with Admin and new test account with subscription role, when I search for unprotected post with that account the result will show properly, if I however search for protected post it will not show in search result which is desired behaviour and as soon as I assign a membership that has access to that post I can see it in search results.

    So, from my end it seems like everything is working properly on your site.
    Can you give me some more info about this and what terms are you searching for and for which users it doesn't show?

    Please advise.

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Thomas,

    I accessed your site and got similar results to those that you have: as an admin I received search results and as a visitor (which in this case would be similar to regular subscriber without any membership assigned) I had none, even though two of three pages returned in "admin search" seem to be available for visitors (not protected).

    However, further review, including using "Test Membership" tool (that you can access as an admin from the top admin toolbar when logged in to the site) suggests that there might be some "protection rules" conflict. There's a lot of rules enabled on the site and as I'm not entirely sure how the site should work (I mean: what should be protected and what shouldn't etc) I wasn't able to spot aforementioned conflicts "right away" (if there are indeed any).

    I know that you already tried to disable that "search" plugin and it didn't help but can you confirm that without Membership 2 Pro protection that works fine? Could you please disable the Membership 2 Pro plugin just for a moment and then test if these search results are available for everyone?

    If yes, then enable it back and we'll try to trace potential "protection rules" conflict. In that case, you should also try to use "Test Memberships" tool to see what rules are "in action" for particular memberships - that might help you identify potential culprit that we could then find a solution for.

    Kind regards,
    Adam